I would like to add a class to the element <html>and run the code for it in the element <head>. What is the best way to do this?
document.getElementsByTagName('html')[0].className = 'class';
or
document.documentElement.className = 'class';
source
share