Itay Moav -Malimovka Itay Moav -Malimovka - 1 year ago 101
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?

Answer Source

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

Check here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download