Hacker News new | ask | show | jobs
by ratww 1986 days ago
You can use forEach without the splat:

    document.querySelectorAll(".className").forEach(el => el.classList.add('newClass'));
1 comments

Still doesn't seem like much of a win compared to the jQuery :)

    $(".classname").addClass("darktheme")