Adding a "no-js" class to the html element

Would it be possible to add a “no-js” class to the HTML element by default, so we can run a JS test that will change the value if the browser supports JS?

This would be handy for providing fallback functionality for browsers that don’t support JS, or have it turned off.

Alternatively, is there any way to access the html or body element to add these default classes manually?

// Check for JavaScript support
document.documentElement.classList.replace('no-js', 'js');

Hope this makes sense, thanks!