To add a class to the html element with JavaScript, we call the classList.add
method.
For instance, we write
document.documentElement.classList.add("myCssClass");
to get the html element with document.documentElement
.
Then we call classList.addto add the
myCssClass` to it.