Why reinvent the wheel? Plenty of scripts out there to do this. Like this one that looks like it uses classList. Maybe it give u a clue with your own script.
Thatās true, but sometimes you want to create something yourself, if only to learn something? You donāt learn anything if you just use ready to use scripts. Especially if youāve gone all the way to convert something and then fails, Iād like to find the issue as well.
Not yet.
I know most of the answers beforehand⦠āuse wow.jsā, āuse Jqueryā, āuse a polyfillā or be bombed away by āduplicateā.
Maybe iāll do it if i canāt find a clue but until now iāve not given up on it (completely). Itās just a side spare time script⦠so no hurry.