javascript - Select and open a selectbox with jquery -
i know can focus , select html selectbox drop-down jquery:
<script> $('#otherbox').on('change', function() { $("#selbox").focus(); $("#selbox").select(); }); </script>
but focuses selectbox doesn't open it, still have click on select-element mouse open it.
how can automatically open selectbox event?
there 2 ways it:
you can either try use
mouseevent
simulatemousedown
(https://developer.mozilla.org/en/docs/web/api/mouseevent + check links in comments)or can create invisible div
select
's options duplicated in right underselect
, uponclick
event make div visible, emulating open dropdown.
Comments
Post a Comment