Why does jQuery not see a checkbox has been auto checked?
Why does jQuery not see a checkbox has been auto checked? I have some jQuery checking to see when a human clicks a check button but if the page loads with the button marked as checked already, the jQuery doesn't work. $ (function(){ var requiredCheckboxes = $('.options :checkbox[required]'); requiredCheckboxes.change(function(){ if(requiredCheckboxes.is(':checked')) { requiredCheckboxes.removeAttr('required'); } else { requiredCheckboxes.attr('required', 'required'); } }); }); What I need this to do is if the checkbox is already checked, it removes the required attribute. Why is it not working when a variable is posted to the page and PHP adds checked="checked" to the input? Thanks! I should clarify, this is to check to ensure one of the check boxes is checked during validation. – Eric T...