Skip to content

Instantly share code, notes, and snippets.

@pixelhijack
Created July 17, 2014 17:35
Show Gist options
  • Save pixelhijack/626119884adc2797ef8f to your computer and use it in GitHub Desktop.
Save pixelhijack/626119884adc2797ef8f to your computer and use it in GitHub Desktop.
no-js detection
<html class="no-js">
<head>
<!-- no-js detection -->
<script>(function(e,t,n){var r=e.querySelectorAll("html")[0];r.className=r.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")})(document,window,0);</script><!-- remove this if you are using Modernizr -->
</head>
<!-- add a class .no-js and remove if there's js. (~ Modernizr ) -->
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment