Why not work with onchange
event?
$("#sel").change(function(){
$('body').append("<br/> Option changed");
});
Here is the fiddle
But it won’t fire an even when selection is the same. Work around is to use a plugin like Chosen as suggested in another answer.
EDIT: Philosophically speaking select
element is not meant for such functionality. change
event suffices for most use cases related to select
tags. The functionality that you desire, that is to know if a user has made a selection over the element (even if it hasn’t change), doesn’t fit the functional model of the select
tag. Logically nobody would want to click on a select
element if he/she doesn’t want to change the selection.
To fit your requirement, you can give a Go button
besides your select tag and call the same function onclick
that you would normally do with the onchange
event of select
element. Otherwise give a hovercard/hover-menu instead of select
.