There are two methods jQuery prop() and jQuery is() you can use to find the checkbox if it is checked or not.. I will give you very basic example and demo so you can see how it get selected checkbox value in jquery. jQuery is a fast, small, and features rich JavaScript library. jQuery :checked Selector jQuery Selectors. Using jQuery you can determine if a checkbox has been checked, performing an action based on the result. In addition to the above example, you can also get value for multiple selections. – check selective boxes within the block or page. Create a List box and a checkbox for select or unselect all options in List. Live Demo You can check or uncheck a checkbox element or a radio button using the .prop() method: Click the checkbox given above or click each checkbox. Lets consider we have the document setup below and see how to test checkbox checked using different versions of jQuery. You better use some class with the dependent checkboxes so that it … Syntax $(":checked") jQuery Selectors. (select boxes based on css class in block or page) The best way to do this is to use is to use is(":checked"). Example. $ ('input [name=foo]').is (':checked') $ ('input [name=foo]').attr ('checked') Set the checkbox to checked or not checked jQuery Script to Check or Uncheck. For illustration purposes, when the CheckBox is clicked based on whether it is checked (selected) or unchecked (unselected), a function will be called within which the HTML DIV with TextBox will be shown or hidden using jQuery. Is this website helpful to you? The checked attribute value does not change with the state of the checkbox, while the checked property does. But, before learning this, you should know how to make checkbox checked.So, let’s start learning. $('input[name=foo]').is(':checked') $('input[name=foo]').attr('checked') Set the checkbox to checked or not checked Syntax $(":checked") jQuery Selectors. Just to say in my example the situation was a dialog box that then verified the check box before closing dialog. Hence, today we are going to help you to check or uncheck checkbox using jQuery. Do not misunderstand it with the checked attribute. Posted in: Using jQuery Core > Frequently Asked Questions How do I check/uncheck a checkbox input or radio button? The best way to do this is to use is to use is (":checked"). But what do you do if you need to have to do something when the status of the checkboxes changes? is(): This method is also very simple and easy to use. Last Updated: 17-09-2019. jQuery :checked Selector jQuery Selectors. You have same id for checkboxes and its should be unique. The jQuery prop() method provides a simple, effective, and reliable way to track down the current status of a checkbox. Each will return true if it’s checked or false if it’s not. You can use the jQuery prop() method to check or uncheck a checkbox dynamically such as on click of button or an hyperlink etc. Here Mudassar Ahmed Khan has explained with an example, how to call a function when an HTML CheckBox is checked (selected) or unchecked (unselected) in jQuery.