16
rated 0 times
[
19]
[
3]
/ answers: 1 / hits: 30371
/ 12 Years ago, tue, january 15, 2013, 12:00:00
I have the following Element:
<select id=color name=colorId class=btn secondary>
<option value=347366 selected=selected>Purple</option>
<option value=56634>White</option>
</select>
And I want to find which option is selected:
The following give me only the default:
document.querySelector('#color option[selected=selected]')
(I know how to do it with JQuery but, I can't use jQuery or any other similar library)
More From » html