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.