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
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…