我有一段时间JQuery代码,但我今天已经使用了一段时间,但今天我遇到了一个障碍 - 这个障碍是以数组输入的形式出现的。隐藏id使用jquery,但输入是一个数组
<div id="primary"> //oopse this one contains the survey info
<input type="radio" name="quest[]" value="yes"> //was typing fast didnt realize i typed checkbox meant radio
<input type="radio" name="quest[]" value="no">
</div>
<div id="idnum"> // this one shows only if yes is selected
blah blah blah
</div>
所以输入发送查询[] 我顺理成章的事情说,不使用数组 - 然而,这是不是一种选择。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("#quest[] selected").change(function (e) {
if ($(this).val() == "Yes") { //if query[] = Yes then run following
$("#idnum").hide(); //hide div id=idnum
}
else { //if it no longer shows yes then run following
$("#idnum").show(); //show div id=idnum
}
});
});
[]数组有这个阵列对于其他问题下的其他值也 我怎么解决这个问题集中在阵列中的一个特定的输入 - 每个div有不同的ID和我有找的能力数组[数字]如果需要的话。
对不起固定的一些事情并注明有点
我不知道这是否是可能的,但有没有可能与在特定
'quest []'不是ID属性的值,对吧? – undefined 2012-08-17 17:19:26
no quest []是单选按钮 – 2012-08-17 18:21:32