Posted By

radarseven on 08/24/09


Tagged

textmate check jquery checkbox checked


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


jQuery Checkbox Checked Checking


 / Published in: Other
 

  1. <script type="text/javascript" src="jquery-latest.pack.js"></script>
  2. <script type="text/javascript">
  3. $(document).ready(function(){
  4.  
  5. //Hide div w/id extra
  6. $("#extra").css("display","none");
  7. // Add onclick handler to checkbox w/id checkme
  8. $("#checkme").click(function(){
  9.  
  10. // If checked
  11. if ($("#checkme").is(":checked"))
  12. {
  13. //show the hidden div
  14. $("#extra").show("fast");
  15. }
  16. else
  17. {
  18. //otherwise, hide it
  19. $("#extra").hide("fast");
  20. }
  21. });

Report this snippet  

You need to login to post a comment.