vanilla-js-dropdown
vanilla-js-dropdown copied to clipboard
Change elem to querySelector not just ID
Plz, change elem to querySelectorAll instead getElementById
. Now I need to init plugin 8 times for each select and if I add another one in the future, than I need modify JS to add them too... so annoying :/
@Malin88 - this seems to work for me.
let selectDropdowns = document.querySelectorAll('select');
selectDropdowns.forEach((dropdown) => {
new CustomSelect({
elem: dropdown
});
});