44
rated 0 times
[
48]
[
4]
/ answers: 1 / hits: 15895
/ 8 Years ago, fri, december 9, 2016, 12:00:00
I want to remove all elements with class sample
.
This is working well in Chrome and Safari:
document.querySelectorAll('.sample').forEach(function(e) {
e.parentNode.removeChild(e);
});
Here is the error I get in Firefox:
TypeError: document.querySelectorAll(...).forEach is not a function
More From » foreach