Hello World! New episode of the series - A CSS/JS trick in 5 minutes.
let foo = document.querySelector("#foo"); element.classList.add("newClass");
You can also check if an element contains a class (and then perform operations with the boolean result):
Hope this helped and thanks for reading!
Please smash that like button to make me understand that you want the series to continue :)