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

March 14, 2010, 10:03 pm

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 under jquery, snippets | Comments (7)