i am working with a select. I want to trigger and event when the user select a value.
I am using the event "change", the problem is that if a user open the select but choose the same option that is selected, the triggers doesn't fire.
Is there a way to capture the event when a user select an option independently if the option is the same than is the one that was selected?
thanks.
You can catch both the change and click events using the bind method. This should allow you to catch most keyboard and mouse interactions
$('selector').bind('click change',function() {})
I'm not sure whether it's a cross-browser solution but something like this:
$("#mySelect option").click(function() {
// do sth
});
Works well in Opera/Firefox.
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