select an element from drop down code example Example: javascript select element in dropdown document.getElementById("stateSelect").selected = true;