In this post, I try to make some script for handling checkbox event with jQuery. HTML checkbox object support all standard events, so I will cover them by updating this entry when I received any question.

Don't forget to include jQuery library when run the following script
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
Firstly, sometime, you have to check a checkbox is checked or not to change some related element in form or load some component. Let's start with click event handling and "checked" attribute of checkbox

Demo checkbox click event handling

Check box here

Source code

HTML

Javascript
/**copy value when click on checkbox*/
  $('#ct_checkbox').click(function(e){
   
         if($(this).attr('checked') == 'checked'){
              alert("unchecked !");
         }
         else{
             alert("checked !");
           }
         
         $(this).attr('checked', !$(this).attr('checked'));
        
   });