1

I have

$('.loading-overlay').removeClass('hidden');

and I have to rewrite the code without jQuery. How can this be done?

Geray Suinov
  • 3,521
  • 3
  • 16
  • 19
  • possible duplicate of [Remove class using javascript](http://stackoverflow.com/questions/11494266/remove-class-using-javascript) – Suresh Atta Aug 21 '13 at 11:41
  • Your question is not clear. Please provide more details. – Akki619 Aug 21 '13 at 11:42
  • Hints: http://stackoverflow.com/a/2155787/921204 - https://developer.mozilla.org/en-US/docs/Web/API/document.getElementsByClassName – techfoobar Aug 21 '13 at 11:42

2 Answers2

1

Removing:

document.getElementById("yourElement").className = "";

Assigning new one:

document.getElementById("yourElement").className = "yourNewClass"

Though, this method removes all classes.

IgnasK
  • 384
  • 2
  • 19
1
document.getElementById("elementId").className =
document.getElementById("elementId").className.replace(/\burClassName\b/,'');
sachin
  • 13,605
  • 14
  • 42
  • 55