3

I have a simple html dropdown, I wants to use jQuery if possible to display all the options if this control has the focus(as if the user click on the dropdown). I have tried jQuery trigger(), click(), to avail.

 <select id="single"> <option>Single</option> <option>Single2</option> </select> 
0

2 Answers 2

2

Since the UI element that represents the drop-down-list comes from the host browser, it's not really inside the JS sandbox - rather, we merely have a DOM object that represents the things about the element we can manipulate - option list, style, and which index is selected. The behavior of interacting inside the element - expanding/collapsing, etc happens at the browser chrome level - same as tabs, file menu, etc. - outside the JS sandbox. The standard does not call for notifying the DOM when the DDL is opened, only when it is focused.

So, short answer - no.

Sign up to request clarification or add additional context in comments.

Comments

1

I would recommend using a comboBox. That should allow you to do what you want.

http://simpletutorials.com/?path=tutorials/javascript/jquery/ddcombobox

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.