Using JQuery or JavaScript, I want to detect when a user selects a value, even if they don't change the already selected value.
How can this be accomplished?
I tried -
$('#MyID').select(function(){ /*my function*/ });
and
$('#MyID').change(function(){ /*my function*/ }); //nothing changing, so this fails
But they do not work.
Example - I have a dropdown with a list of years in it with nothing selected, the user selects "1976", I run a function. With "1976" selected, the user clicks on the dropdown again and selects "1976" again, I want to run the function again.
Have you tried something like:
Here you are detecting clicks on the list elements inside your dropdown, which should be the different options. (If your HTML is slightly different, just inspect it and see what all the options have in common, what kind of elements are they?)