Thursday, July 5, 2012

Asp.Net jQuery checkbox get value


In this post Asp.Net jQuery checkbox get value, we shall see on how to get value of a checkbox using jQuery.

We can get the value of a checkbox using the following syntax.

alert($('label[for=' + $('#chkStatus').attr('id') + ']').html());

To get the checked value, on click of a button uses the following script.

// Get CheckBox Value
$('#cmdGetCheckboxValue').click(function(event) {
    event.preventDefault();
    alert($('label[for=' + $('#chkStatus').attr('id') + ']').html());
});


Search Flipkart Products:
Flipkart.com

No comments: