jQuery Hide stops working
I have a few divs that need to be hidden unless a check box is checked.
Hiding them is no problem. This code does result in them being hidden:
$(document).ready(function() {
$('div.dd').hide();
$('div.gar').hide();
});
but as soon as I add anything below the hide , the divs are no longer hidden. Here is the code I'm adding:
$('#dd_yes').click(function(){
if($(this).is(":checked") ){
$('div.dd').show();
}
else{
$('div.dd).hide();
}
}
#dd_yes is the id for the checkbox that should be checked to make the div dd show.
Basically, if there is any code other than the hides, the divs show up.
Please help!