3 ms·
You can use forEach without the splat: document.querySelectorAll(".className").forEach(el => el.classList.add('newClass'));
by ratww 6y ago
You can use forEach without the splat:
document.querySelectorAll(".className").forEach(el => el.classList.add('newClass'));
- jamiesonbecker 6y agoStill doesn't seem like much of a win compared to the jQuery :) $(".classname").addClass("darktheme")