javascript append tag to classname code example
Example 1: javascript give class to element
element.classList.add("div-class");
Example 2: add class to html tag javascript
var root = document.getElementsByTagName( 'html' )[0]; // '0' to assign the first (and only `HTML` tag)
root.className += ' responsive';