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:
See Question&Answers more detail:osTypeError: document.querySelectorAll(...).forEach is not a function