Created
November 6, 2012 12:55
-
-
Save jelmerdemaat/4024553 to your computer and use it in GitHub Desktop.
Change <html> class name (e.g. no-js)
This file contains hidden or 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
// 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