The HTML:
<select id="selected2"> <option selected>1</option> <option>2</option> <option>3</option> </select>
I've tried using this code in JavaScript:
var dataCap = document.getElementById("selected2");
var userSelect = dataCap.options[dataCap.selectedIndex].text;
But console says: "TypeError: dataCap is null"