Skip to content

Instantly share code, notes, and snippets.

@jelmerdemaat
Created November 6, 2012 12:55
Show Gist options
  • Save jelmerdemaat/4024553 to your computer and use it in GitHub Desktop.
Save jelmerdemaat/4024553 to your computer and use it in GitHub Desktop.
Change <html> class name (e.g. no-js)
// source: http://stackoverflow.com/questions/8708826/how-to-replace-class-html-name-with-javascript
var els = [].slice.apply(document.getElementsByClassName("no-js"));
for (var i = 0; i < els.length; i++) {
els[i].className = els[i].className.replace(/ *\bno-js\b/g, "js");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment