javascript select element in dropdown

JavaScript
document.getElementById("stateSelect").selected = true;
Source

Also in JavaScript: