I have two select list:
<select id="one" class="sel">
<option id="1">1</option>
<option id="2">2</option>
<option id="3">3</option>
</select>
<select id="two" class="sel">
<option id="1">1</option>
<option id="2">2</option>
<option id="3">3</option>
</select>
and span:
<span id="three">set three</span>
i would like click on this span and should in two list select (id one and two) be option id=3 selected.
How can i make it?
$("#three").click(function(){
$(".sel") ... ????
})
LIVE: http://jsfiddle.net/rUbGx/
btw. i would like example with ID in option, not with value. Thanks.
You can use attribute selector.
Working demo