Home › Forums › JavaScript › stylesheet change if javascript is enabled › Re: stylesheet change if javascript is enabled
January 28, 2012 at 5:11 am
#95601
jamygolden
Member
Check out Modernizr.
A class of ‘no-js’ must be given to the <html> element for the plugin to take effect. If it loads and fires correctly (javascript enabled) that class is removed and other classes are added to the html element (read about modernizr to find out more about that). Very basically though, you can use .no-js to style your web-page for people who don’t have it enabled.
.no-js #main-content { display: none; }
.no-js #js-disabled { display: block; }
those are just two small examples, but you get the idea.