I have multiple span
elements, I try to remove the class activeLang
.
How can I do this?
<div class="header_content_lang">
<span class="langNav">
...
</span>
<span class="langNav">
...
</span>
<span class="langNav activeLang">
...
</span>
</div>
I tried it like this, just like suggested here:
var x = document.getElementsByClassName(".activeLang");
[].forEach.call(x, function(el) {
el.classList.remove(".activeLang");
});
console.log(x[0]);
console.log(x[1]);
console.log(x[2]);
But output is "undefined" for all logs.