.is, , . . ,
if( $('#item').is(':checked')){
..
Edit:
, jQuery $('#item').attr('checked') true. checked undefined.
,
.attr ('checked') after 1.6 correctly returns a string (all attributes are strings). If you want a boolean property, use the new .prop () Method
If you want to compare true, use this.checked. See below, <- I prefer to use this.checkedit as it is faster than any other method.
if (this.checked === true) {
..
or
Use .propas shown below DEMO
if($(this).prop('checked') === true) {
..
Demo
source
share