Firefox / Internet Browser Behavior with Select / Select Element in Select Tag

I noticed that in firefox, when you click on the arrow to open the "select" tag of the drop-down list and then specify one parameter, the line is highlighted in blue, as I expect, this is normal,

But in Internet Explorer, when you click on the parameter you want to select and it becomes selected, the blue highlight remains until you click somewhere else outside the select tag.

Is there any way to change this behavior?

+5
source share
3 answers

One way is to use JavaScript. I used jQuery to simplify it: JSFiddle example .

$('select').change(function() {
    $(this).blur();
})

.

JavaScript, onchange.

+5

, , ( jsfiddle IE wilsonrufus).

, , :

var select = $('select');

select.change(function() {
    select.blur();
})

$('select option').click(function() {
    select.blur();
})
+4

This will take care of choosing a new option, as well as choosing the same option:

$('select > option').click(function () {
    $(this).parent().blur();
})
0
source

All Articles