javascript – Reset value of a select field with jQuery/Boostrap


Hi, how can I reset a select field?

<label for="IDSelect">Campo</label>
<select data-live-search="true" title="--" name="NAMESelect" id="IDSelect">
    <option value="1">Valor 1</option>
    <option value="2">Valor 2</option>

Note that the default value when loading the page is "–", I want that after selecting an option and submitting this form (submit with jquery), go back to the default value "–"


To reset the boostrap select you have to do:



With .val('') say that the value should be cleared and with .selectpicker('refresh') you make it refresh 🙂

( you could also use it like this , with .trigger('change') )

Scroll to Top