I have repeatable elements
<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>
....
With change of the checkbox I want to show only next “other” class. It doesn`t work:
$('.other').hide(); //hide all "other" elements
$('.chkClass').live('change', function(){
if($(this).is(':checked')){
$(this).next('.other').show();
}
});
I get it, but I needed to set ID for every element: