1. Using The <noscript> Tag
With HTML5, you can even add the noscript tag to the head of the document, prior to that, it was limited only to the body tag. This gives it another edge over all other methods, since you can now declare styles even before the content of the page has loaded.
- Doing Complete SEO Of Your WordPress Website With WordPress SEO By Yoast
- Turn OFF Autosave In WordPress And Reduce Database Size
- How to Edit .htaccess File from WordPress Dashboard Itself
- 4 Ways To Enable Gzip Compression In WordPress
- Optimizing Database For WordPress Websites Automatically [Free Plugin]
document.getElementsByTagName("html").className = document.getElementsByTagName("html").className.replace(/(?:^|\s)no-js(?!\S)/g, ' js')
This code will replace all the instances of ‘no-js’ with ‘js’ from the class attribute of the HTML tag.
This is what I am implementing on all my projects. Do let me know if you have any better way of doing it.