I have a table full of select elements, some of which are prefilled with suggestions for a data migration project I'm working on. I know how to listen for a change event (jQuery) but I also want to listen for when the user selects the suggested option. Is that possible?
I tried listening for a click but that only gets called when the select box is opened not when its closed.
Update
A simple reproduction of the problem -
HTML -
<select>
<option value="">One</option>
<option value="" selected>Two</option>
<option value="">Three</option>
</select>
<p></p>
JS
$('select').change(function() {
$('p').append('x');
});
https://jsfiddle.net/sh9n2cvg/
Update 2
The best I've found so far is this, but its still a little buggy -
$('select').click(function() {
$(this).val("");
$(this).trigger('change');
});
Update 3 I don't think what I'm trying to do is possible. This is my workaround - https://stackoverflow.com/a/5859221/772309