Add hasJS class to HTML element

/ Published in: JavaScript
Save to your folder(s)

Adds a class of hasJS to the html element, can be used for CSS styling.

Copy this code and paste it in your HTML
  1. <script type="text/javascript">document.getElementsByTagName('html')[0].className = 'hasJS';</script>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.