How do I disable ALL checkboxes on a page that are not checked? Do I need to first scan through all the checkboxes or is there a simpler way? I’m still a jQuery newbie
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Obviously a user won’t be able to ever select them again, as you’ve disabled them…
See the
:checkbox,:not, and:checkedselector, as well as theprop()method.If you’re not using jQuery 1.6.x, then you won’t have the
prop()method; so use theattr()method instead:You can see this working in a jsfiddle that was posted in the comments: http://jsfiddle.net/loktar/LRL2k/1/