mrmartineau
11/18/2017 - 10:18 PM

JS/no-js class

JS Body class

Best

// window.document.documentElement.className.replace('no-js', 'js');
window.document.documentElement.className = window.document.documentElement.className.replace(/\bno-js\b/g, '') + ' js ';

(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)

Add to <html>

<script>document.body.parentElement.className = document.body.parentElement.className.replace('no-js', 'js');</script>

Add to <body>

<script type="text/javascript">document.body.className = ((document.body.className) ? document.body.className + ' js' : 'no-js');</script>