+ Almost all quality improvement comes via simplification of design, manufacturing... layout, processes, and procedures.

September 7, 2008, 10:25 am

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)
  1. Check me
  2. <input name="checkbox" type="checkbox" onclick="$(this).is(’:checked’) && $(’#checked’).slideDown(’slow’) || $(’#checked’).slideUp(’slow’);" />
  3. <p style="display: none; margin: 10px; height: 100px; background-color: #f5f5f5; padding: 10px" id="checked"> </p>
  4. Put some content here

Basicly the paragraph container named checked is hidden untill one presses the checkbox.

Click here for a demo

Posted by Anthony LeBoeuf under snippets, jquery |

4 Comments »

  1. why do i have to leave a comment?

    Comment by Barry Burton — June 18, 2008 @ 3:05 pm

  2. sdfdsfsfxfsf

    Comment by Barry Burton — June 18, 2008 @ 3:05 pm

  3. Hi Barry, you dont have to leave a comment lol. Its a feature built into wordpress.

    Comment by Anthony LeBoeuf — June 18, 2008 @ 3:10 pm

  4. Nice!

    Comment by Nick — August 6, 2008 @ 11:52 am

RSS feed for comments on this post. | Trackback

Leave a comment

XHTML ( You can use these tags): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> .

*
To prove that you're not a bot, enter this code
Anti-Spam Image