Hide elementes only if JavaScript is enabled.
Last active
December 23, 2015 02:48
-
-
Save hofmannsven/6568844 to your computer and use it in GitHub Desktop.
Hide elements only if the user has JavaScript enabled (e.g. great for a JavaScript animation)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- class will be added, but only if JavasSript is enabled --> | |
<script type="text/javascript"> | |
document.documentElement.className = 'js'; | |
</script> | |
<!-- hide elementes if JavaScript is enabled --> | |
<style type="text/css"> | |
.js .container { display: none; } | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment