find selected value in dropdown out of dropdown code example

Example 1: javascript get selected option

var e = document.getElementById("selectElementID");
var value=e.selectElement.options[e.selectedIndex].value;// get selected option value
var text=e.options[e.selectedIndex].text;//get the selected option text

Example 2: How to select a value in a dropdown

How do you handle Select type of dropdown?
    - If it is  web element.
    -> return type: List

Tags:

Misc Example