I have an html dropdown. I want to fire an event whenever the selection changes in any way. I tried registering a 'click' event but this didnt work when multi-selecting (either by dragging the mouse or holding down shift + down arrow).
So basically, how can I fire an event on any selection change?
Try using the onchange
event.
$('#mySelect').change(function(){
alert($(this).val());
});
Would .change() do the trick?
http://api.jquery.com/change/
Certainly there seems to be a working demo of a multi-select box on that page...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With