0

I have to find element by class name and remove this class.

I tried to use:

document.getElementsByClassName('error-sign-up').removeClass('error-sign-up');

but I got an error -Uncaught TypeError: undefined is not a function.

sarit rotshild
  • 733
  • 2
  • 10
  • 19
  • `.removeClass` is a jQuery method, it is not included in a HTMLCollection that `getElementsByClassName()` returns. – Teemu Apr 06 '15 at 09:16
  • Also, `removeClass` is jQuery method, here's the dupe for that -> http://stackoverflow.com/questions/2155737/remove-css-class-from-element-with-javascript-no-jquery – adeneo Apr 06 '15 at 09:17

1 Answers1

0

Try this example

$('span.error-sign-up').each(function(index,item){
  $(item).removeClass('error-sign-up');
})

Demo

Manoj
  • 4,951
  • 2
  • 30
  • 56