Skip to content

Instantly share code, notes, and snippets.

@mikelikesbikes
Created November 10, 2009 15:45
Show Gist options
  • Select an option

  • Save mikelikesbikes/230966 to your computer and use it in GitHub Desktop.

Select an option

Save mikelikesbikes/230966 to your computer and use it in GitHub Desktop.
.js-enabled,
html.js .js-disabled {
display:none;
}
html.js .js-enabled,
.js-disabled {
display:block;
}
<html>
<head>
<script type="text/javascript">
var el = document.getElementsByTagName("html")[0];
el.className += " js";
</script>
</head>
<body>
... lots of HTML ...
<p class="js-enabled">Show this when JS is available</p>
<p class="js-disabled">Show this when JS is unavailable</p>
... lots more HTML ...
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment