I am using a datalist and must determine when the user selects something from the drop-down list. A similar question was asked , but I need this to trigger the event ONLY when the user selects something from the datalist. If they inject something into the input, then I DO NOT want the event to fire. (Note that in the accepted answer to the question I linked, they link the input, which I don't want). I tried (without success):
<datalist>
<option>Option 1 Here</option>
<option>Option 2 Here</option>
</datalist>
$(document).on('change', 'datalist', function(){
alert('hi');
});
EDIT: This question is different from the proposed question because it is a completely different question.
Brent source
share