I was under the impression that in order to get the value from <select>
you essentially had to do this:
var sel = document.getElementById("my-select");
var val = sel.options[sel.selectedIndex].value;
But I ran into some code today that simply does document.getElementById('my-select').value
, which seems to work perfectly fine in Chrome and Firefox.
Has this changed recently, or has it always been this way? How far back is this supported?