Skip to content

Instantly share code, notes, and snippets.

@baladkb
Created June 29, 2017 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baladkb/c7d7434a5abecf6631a04325813759e0 to your computer and use it in GitHub Desktop.
Save baladkb/c7d7434a5abecf6631a04325813759e0 to your computer and use it in GitHub Desktop.
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