We used .attr() method to get the attribute value of a checkbox. Which would return “checked” if the checkbox state is checked. But as of jQuery 1.6 it will return undefined if checkbox state is not set.
Therefore, if you are still using previous jQuery, you can check state of checkbox input like so :
Those of you using jQuery 1.6+, you can use .prop() method instead to find-out checkbox state, which returns true or false.