show div on check for checkbox
December 11, 2007
Sometimes you need to show a div when you click a checkbox, here is how yo do it. You need jquery to establish this.
Code (html)
-
Check me
-
-
<input name="checkbox" type="checkbox" onclick="$(this).is(’:checked’) && $(’#checked’).slideDown(’slow’) || $(’#checked’).slideUp(’slow’);" />
-
<p style="display: none; margin: 10px; height: 100px; background-color: #f5f5f5; padding: 10px" id="checked"> </p>
-
Put some content here
Basicly the paragraph container named checked is hidden untill one presses the checkbox.
Posted by Anthony under jquery, snippets | Comments (7)