I am trying to show a div if a checkbox is unchecked, and hide if it is checked. I have this, but I seem to be missing something:
HTML:
<input name="billing_check" id="billing_check" type="checkbox" class="billing_check" size="40" checked="checked"/>
<div class="registration_box01 showme">
<div class="title">
<h4>billing information - infomration associated with your credit card<br />
</h4>
</div>
</div>
Javascript:
$("input[name='billing_check']").change(function() {
(".showme").toggle($("input[name='mycheckboxes']:checked").length>0);
});
Style:
.showme{
display:none;
}
I think you might be checking against the wrong checkbox, should
mycheckboxesbebilling_check. Also, instead of.length, you could check against.is(':checked'), like this:jsFiddle demo