开发者

Can I open a selectbox with JavaScript? [duplicate]

开发者 https://www.devze.com 2023-03-27 04:48 出处:网络
This question already has answers here: Closed 11 years ago. 开发者_如何学Go Possible Duplicate: Show select dropdown in jQuery?
This question already has answers here: Closed 11 years ago. 开发者_如何学Go

Possible Duplicate:

Show select dropdown in jQuery?

Is it possible to open a selectbox with JavaScript? Or with jQuery?


In short: no, it's not possible. Long answer, see How do you open a select box with JavaScript?.


If you want to "open" a selectbox, this is impossible - see Stack Overflow question Click trigger on select box doesn't work in jQuery for more information.

If you want to select a value, you should use .val().


Duplicate: Show select dropdown in jQuery?

Can't be done, you can use .trigger('focus') but it will not open the drop down.

0

精彩评论

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