I’m struggling with the following:
I want to add a class name to another class so I can add something when the checkbox in my panel is checked. I have the following. The checkbox works (tested with some H1) but my Javascript don’t work. Can anybody help me?
The problem is not your Kirby code or in any way Kirby related, but your JavaScript. getElementsByClassName()doesn’t return a single element by a collection of nodes, so you can’t just string classList.add()
I.e. you either have to grab a single element by its index or loop through the node list.