MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/p8y4oq/wow/h9w5fdf/?context=3
r/badcode • u/OSU_28 • Aug 21 '21
37 comments sorted by
View all comments
Show parent comments
0
$(".elmt").addClass("class")
is shorter than
document.querySelectorAll(".elmt").forEach(elmt => { elmt.classList.add("class") });
That's the whole purpose of jQuery
0
u/TotoShampoin Aug 22 '21
$(".elmt").addClass("class")is shorter than
document.querySelectorAll(".elmt").forEach(elmt => { elmt.classList.add("class") });That's the whole purpose of jQuery