I use this code for simulate click
on select
element:
$(function(){ $("#click").click(function(){ $("#ts").click(); //$("#ts").trigger("click"); }); });
and HTML code is:
<select id="ts"> <option value="1">1</option> <option value="2">Lorem ipsum dolor s.</option> <option value="3">3</option> </select> <input type="button" id="click" value="Click"/>
I test click
and trigger
but both not work.
Thanks for any help.
Well, you cannot attach click
event to html select
but you can do this tricky thing...
Take a look at here:
Live DEMO:
http://jsfiddle.net/oscarj24/GR9jU/
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