Skip to content
Advertisement

Resetting Select2 value in dropdown with reset button

What would be the best way to reset the selected item to default? I’m using Select2 library and when using a normal button type="reset", the value in the dropdown doesn’t reset.

So when I press my button I want “All” to be shown again.

jQuery

JavaScript

html

JavaScript

Advertisement

Answer

I’d try something like this:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement