Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
194
rated 0 times [  198] [ 4]  / answers: 1 / hits: 55656  / 13 Years ago, thu, april 7, 2011, 12:00:00

I was looking around to add an event to a checkbox and I would have thought people would use .change to set up a change event but instead I found that people are using .click



Is there a reason for this? They both seem to work fine both with clicked events and with keyboard changes. Am I missing something?



If you don't believe me then try it out yourself


More From » jquery

 Answers
16

onchange in IE only fires when the checkbox loses focus. So if you tab to it, hit space a few times, tab out, you'll only get one onchange event, but several onclick events.



Note: this is one of the very, very, very rare times when IE's behavior is correct (according to spec) and other browsers are wrong.


[#92872] Tuesday, April 5, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
theron

Total Points: 168
Total Questions: 93
Total Answers: 94

Location: South Georgia
Member since Fri, Nov 13, 2020
4 Years ago
;