How to target body in javascript DOM event
You can use document.body
to get to it. To remove the class, you can use:
document.body.className = '';
This will change the contents of the class
attribute to be the empty string, so it will remove all the classes the element might have.
To remove class from 'body' tag use this:
document.body.removeAttribute('class');