How can I clear / reset a select field (that uses data-te-select-init)? #2197
DESIGNfromWITHIN
started this conversation in
Chat about dev stuff
Replies: 1 comment
-
Hi, to achieve this, you need to use setValue() method. Here is an example code:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using a select field #filterBrand as a product filter and added a 'reset filters' button.
My JS:
document.getElementById("filterBrand").selectedIndex = 0;
The code above only works when I don't use: data-te-select-init
How can I reset a data-te-select-init select field in a Javascript function?
Beta Was this translation helpful? Give feedback.
All reactions