Itay Moav -Malimovka Itay Moav -Malimovka - 8 months ago 31
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>

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


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

Check here