vanilla-js-dropdown icon indicating copy to clipboard operation
vanilla-js-dropdown copied to clipboard

Change elem to querySelector not just ID

Open Malin88 opened this issue 3 years ago • 1 comments

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 avatar Jun 15 '21 16:06 Malin88

@Malin88 - this seems to work for me.

let selectDropdowns = document.querySelectorAll('select');

    selectDropdowns.forEach((dropdown) => {
        new CustomSelect({
            elem: dropdown
        });
    });

hunterruth avatar Dec 09 '21 19:12 hunterruth