I need the option element the user clicked on in a multiple select control in Internet Explorer. StackOverflow helpfully suggested these questions:
Get clicked option in multiple dropdown
How to get clicked option value of a multiple select, fired by .change() event
but neither one works in Internet Exploder.
example 1: https://jsfiddle.net/c8q956dr/
$("body").on("click", "select[multiple]",
function(e)
{
log("click: "+ e.target.value);
});
this one works by attaching the click event to the select element, and works perfectly in Chrome/Firefox, as they return the option the user clicked in the event.target member. IE, on the other hand, returns the entire select element and offers no indication which option was clicked.
example 2: https://jsfiddle.net/55up15Lb/1/
$("select option").click(
function(e)
{
log("click: "+ this.value);
});
this one works by attaching the click event handler directly to the option elements, but I cannot get it to work at all in IE.
I've tried IE 8, 9, and 11. am I stuck?