I need to get the selected option value which resides insides a span tag.
<span id ="resolutionSpan">
<select name="resolution" id="resolution">
<option value="0" selected >0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</span>
I have tried
var e = document.getElementById("resolution");
console.log( e.options[e.selectedIndex].text);
But that returns a null value. Do i need to iterate the span first?
Due to project limitations, i cant use jquery. Need ur comments in javascript