Remember that the onchange event is fired after you check the box, and then leave the box checked . Did you try to check it and then click elsewhere in the document?
You might want to use click and keystroke in jQuery instead (to check a field with a click and space).
<sidequestion> Is there a reason why you declare / define a function in your finished paragraph of the document, and not outside it? </sidequestion>
Another edit; can i recommend this more elegant code:
jQuery(document).ready(function(){ $("#g_1").hide(); $("#check").change(function() { $("#g_1").toggle(); }); });
cLFlaVA Dec 15 '08 at 16:09 2008-12-15 16:09
source share