0
我有重复的元素显示下一类元素
<input style="display:inline" class="chkClass" type="checkbox" value="1"/>
<div class="other">
//something
</div>
<input style="display:inline" class="chkClass" type="checkbox" value="1"/>
<div class="other">
//something
</div>
....
随着我只想显示下一个“其他”类复选框的变化。它不`吨的工作:
$('.other').hide(); //hide all "other" elements
$('.chkClass').live('change', function(){
if($(this).is(':checked')){
$(this).next('.other').show();
}
});
另一个$(”。其他')。hide()应该在功能 – 2012-07-14 19:19:45
里面,你想隐藏并显示在支票上,或者只是显示,如果不勾选,就不打扰隐藏?因为你的代码应该工作得很好,如果你不想隐藏,如果没有选中,除非你得到任何js错误。 – Kishore 2012-07-14 19:23:11
定义“不起作用”。它的作品[这里](http://jsfiddle.net/fUHXz/) – Engineer 2012-07-14 19:24:50