Check Checkbox State


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function onClickCb(){
  2. if($('#cb').is(':checked')){
  3. $("#div1").show();
  4. }else{
  5. $("#div1").hide();
  6. }
  7. }
  8. onClickCb();
  9. $("#cb").click(onClickCb);

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.