88
rated 0 times
[
93]
[
5]
/ answers: 1 / hits: 37267
/ 11 Years ago, thu, april 11, 2013, 12:00:00
I am trying to find a way to run a JavaScript function when a user selects an option in an HTML select
box, regardless of whether this option was already selected. So onchange
is out of the question.
The problem with using onblur
is that (in Chrome and Safari, at least) the event is not triggered until the user clicks another element. This can also prove annoying if the user focuses on the select, then clicks away without choosing an option, in which case I do not want the event to be triggered.
I was able to get some success by giving each of the options an onmouseup
handler, but this only works in Firefox, as far as I can tell. Any ideas?
More From » select