How to get the CLICKED option from select [multiple] in Internet Explorer

I need the option element that the user clicked on the multiple choice button in Internet Explorer. StackOverflow suggested the following questions:

Get click access in multiple drop-down lists

How to get clicked parameter value for multiple selection raised by .change () event

but none of them work in Internet Exploder.

Example 1: https://jsfiddle.net/c8q956dr/

  $("body").on("click", "select[multiple]",
               function(e)
               {
                   log("click: "+ e.target.value);  
               });

this works by attaching the click event to the select element and works fine in Chrome / Firefox as they return the parameter that the user clicked on the event.target element. IE, on the other hand, returns the entire select element and offers no indication of which option was clicked.

2: https://jsfiddle.net/55up15Lb/1/

  $("select option").click(  
               function(e)
               {
                   log("click: "+ this.value);  
               });

, click , IE.

IE 8, 9 11. ?

+4

Source: https://habr.com/ru/post/1589508/


All Articles