I have a SELECT element with a MULTIPLE attribute. When I double-click an option in the list, I want to perform a click-based action .
I understand that the OPTION element does not handle the ondblclick event. If I handle the dblclick event of a SELECT element, is it possible to somehow determine which option was double-clicked?
<select size="4" name="MySelect" multiple="multiple" ondblclick="myFunction();"> <option ... /> ... </select>
A cross browser is preferred, but only IE will do.
EDIT
I was obviously not clear enough. What I need to do is determine which was double clicked from the event handler (or that the double click was in the area of ββthe SELECT element with no option). The selectedIndex search will not be performed, since the SELECT element has the MULTIPLE attribute: if the user holds CTRL or SHIFT when double-clicking, several elements will be selected: I only need the option that was actually double-clicking.
javascript html javascript-events
Joe
source share