How to call HTML Select the onClick event (activates a drop-down menu with options)

I want to know how to fire the event of onClickany element select(html combobox element).

I tried doing $('#MySelect').click();with jQueryand tried document.getElementById('MySelect').click();using pure javascript.

But these two do not fire a drop-down list event that has selection options.

Ps: I'm sure the selector $('#MySelect')exists.

+4
source share
2 answers

you are looking for it

  document.getElementById("MySelect").selectedIndex=3;
+4
source

click . , , .

0

All Articles