adding a class to the body if JavaScript was available


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

Demo: http://examples.oncemade.com/hasjs.html


Copy this code and paste it in your HTML
  1. jQuery(function($) {
  2. $('body').addClass('hasJS');
  3. });
  4.  
  5. css
  6.  
  7. .hasJS .module {
  8. display: none;
  9. }

URL: http://oncemade.com/adding-hasjs-class-when-javascript-is-available/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.