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="//"></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


/**copy value when click on checkbox*/
         if($(this).attr('checked') == 'checked'){
              alert("unchecked !");
             alert("checked !");
         $(this).attr('checked', !$(this).attr('checked'));