Search code examples
yui

YUI getting selected value from drop down list


How can I get selected value from a drop down list using YUI.

Thanks.


Solution

  • If you're talking about something like the combobox found here: http://developer.yahoo.com/yui/examples/autocomplete/ac_combobox.html

    You can get the value from the element's value property. e.g.

    document.getElementById("text_box_id").value
    

    To see this in action, go to the above link, select a value for the first input box, then past the below code into your browser's address bar:

    javascript:alert(document.getElementById("bInput").value);