开发者

Dropdown list trigger jquery?

开发者 https://www.devze.com 2023-01-20 18:33 出处:网络
Can anybody know the exact reason for this, why drop down is not opening using trigger function. Can anybody Explain this!

Can anybody know the exact reason for this, why drop down is not opening using trigger function. Can anybody Explain this!

开发者_StackOverflow中文版$('select').trigger('click');

Thanks.


You simply can't do this, definitely not cross-browser. Your simulating an event, which isn't the same as the native click event, which opens the <select>.

This is true in other places as well, the same way a .click() on an <a> won't make the browser go to the href.

0

精彩评论

暂无评论...
验证码 换一张
取 消