How to trigger the HTML Select onClick event (activates select dropdown with options)

前端 未结 2 2065
不知归路
不知归路 2020-12-16 05:38

I want to know how to trigger the onClick event of any select(html combobox element).

I tried to do $(\'#MySelect\').click();

2条回答
  •  一向
    一向 (楼主)
    2020-12-16 06:18

    Programatically triggering a click event will only run the defined click handler for that element. As you say in the comments, you have no such method defined, therefore no action will take place.

提交回复
热议问题