Posted By

kwanhon on 07/09/10


Tagged

checkbox


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Some0ne
laurentzziu


Check Checkbox State


 / Published in: jQuery
 

URL: http://api.jquery.com/checked-selector/

  1. function onClickCb(){
  2. if($('#cb').is(':checked')){
  3. $("#div1").show();
  4. }else{
  5. $("#div1").hide();
  6. }
  7. }
  8. onClickCb();
  9. $("#cb").click(onClickCb);

Report this snippet  

You need to login to post a comment.