Get Checkbox Value In jQuery




Here we consider how to get the checkbox value in jQuery. Lets start with one example here. Suppose we have a chakcbox inside form as shown below.




Get Checkbox Value In jQuery, Get Checkbox Value, Get Checkbox Value In JavaScript, jQuery Get CheckBox Value, CheckBox Value In jQuery, CheckBox Value, value of CheckBox In Jquery, CheckBox data in jquery, How To Get Checkbox Value In jQuery, How To Get Checkbox Value, How To Get Checkbox Value In JavaScript, jQuery, JavaScript

Now for getting the value of Checkbox, we can make use of jQuery Value Attribute. First of all find the CheckBox by using its ID or Class. And then use jQuery Value attribute for getting the Value of Checkbox.

$(function () {
         var result = $('#chkBoxID').val();
});






Get Checkbox Value In jQuery, Get Checkbox Value, Get Checkbox Value In JavaScript, jQuery Get CheckBox Value, CheckBox Value In jQuery, CheckBox Value, value of CheckBox In Jquery, CheckBox data in jquery, How To Get Checkbox Value In jQuery, How To Get Checkbox Value, How To Get Checkbox Value In JavaScript, jQuery, JavaScript

If there is a Class in the Checkbox, we can get its Value as shown below.

$(function () {
         var result = $('.chkBoxCls').val();
});






Without using ID or Class, we can get the Value of Checkbox something like this.

$(function () {
         var result = $("input[type='checkbox']").val();
});