I have a body element on which I add a few classes. And I want to remove the no-javascript class from it, after it\'s being read by the browser.
no-javascript
You can avoid all of that work simply by using
Your browser does not support JavaScript!
Since whatever you put inside of noscript tag will be shown if Javascript is turned off and nothing will be shown if JS is turned on.
noscript