I want to add an event trigger on a drop-down <select> list. Example (jsFiddle):
$( document ).ready(function() { $('.lorem').click(function() { alert('ipsum'); }); }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <select> <option class="lorem">1</option> <option class="lorem">2</option> </select> With Firefox, when I click on it, it triggers fine. But on webkit (Chrome/Safari etc), it does not work. Why?
<option>elements, or do you just want to listen for input on the<select>element?clicknot working onoptionelements in all browsers (the reason is simply down to their interpretation of the spec. It's not documented anywhere) it's also bad practice for accessibility reasons. Always usechange, then the problem is moot.