js/jQuery:
$('input[type=checkbox]').click(function(){
// Does not fire if I click a <input type="checkbox" disabled="disabled" />
});
How do I make something happend in jQuery when someone clicks a disabled checkbox?
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.
Reading over the comment again regarding using
readonlyfromJoãoSilva. You could use that and connect it with some logic in the click event.Using
readonlygives you the disabled look, just likedisableddoes but it still lets you click it.Use readonly like this:
Then in your script cancel the event if readonly is set.
DEMO