javascript - jQuery .prop('checked', false) does not work -
html: <form class="form"> <input type="checkbox" id="box" /> check me! </form> js: $( window ).load( function() { var myfunc = function() { if( $( '#box' ).prop( 'checked', false ) ) { $( '.form' ).append( '<p>checkbox not checked.</p>' ); } } $( '#box' ).on( 'change', myfunc ); } ); here jsfiddle http://jsfiddle.net/3pym7/ when use $( '#box' ).prop( 'checked', false ) condition if statement not work, ! $( '#box' ).prop( 'checked' ) works fine! the statement $('#box').prop('checked', false) not return boolean rather set checked property false should not used in condition , normal behaviour if($('#box').prop('checked', false)) could changed test using is() :checked selector. if($('#box').is(':checked')) or i