Itay Moav -Malimovka Itay Moav -Malimovka - 4 months ago 13
HTML Question

How to reset a select element with jQuery

I have

<select id="baba">
<option>select something</option>
<option value="1">something 1</option>
<option value=2">something 2</option>
</select>


Using jQuery, what would be the easiest (less to write) way to reset the
select
so the first option is selected?

Answer

Try this. This will work. $('#baba').prop('selectedIndex',0);

Check here http://jsfiddle.net/bibin_v/R4s3U/