Shiva Srikanth Thummidi
Shiva Srikanth Thummidi

Reputation: 2908

Dropdown list trigger jquery?

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

$('select').trigger('click');

Thanks.

Upvotes: 0

Views: 933

Answers (1)

Nick Craver
Nick Craver

Reputation: 630429

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.

Upvotes: 2

Related Questions