2

Possible Duplicate:
Show select dropdown in jQuery?

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

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
timopeschka
  • 401
  • 3
  • 8
  • 16

3 Answers3

5

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
mmtauqir
  • 8,499
  • 9
  • 34
  • 42
  • Adding this as an option kendo has a dropdown that has an open method https://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist#methods-open – dburmeister Oct 06 '17 at 18:53
1

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().

Community
  • 1
  • 1
JMax
  • 26,109
  • 12
  • 69
  • 88
-2

Duplicate: Show select dropdown in jQuery?

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

Community
  • 1
  • 1
Calum
  • 5,308
  • 1
  • 22
  • 27