Thursday, July 5, 2012

Asp.Net jQuery checkbox click event handler


In this post Asp.Net jQuery checkbox click event handler, we shall see on how to handle the clicked/checked event of a checkbox using jQuery.

We can use the click() event to track the clicked/checked events of a checkbox as follows.

// Checkboxes Checked Event
$('#chkStatus').click(function() {
    alert($('#chkStatus').attr('checked') ? true : false);
    alert($('#chkStatus:checked').val() ? true : false);
    alert($('#chkStatus:checked').is(':checked'));
});

All 3 alerts mentioned return the same result, the checked state of the checkbox, any one of it can be used.


Search Flipkart Products:
Flipkart.com

1 comment:

Unknown said...

Wow awesome explanation ...very good in content delivery
sharepoint 2013 training