4 ms·
No you can't. $('.elements') in jQuery is more equivalent to querySelectorAll('.elements'). You can however do: document.querySelectorAll('a').forEach(a => a.
by yoz-y 5y ago
No you can't. $('.elements') in jQuery is more equivalent to querySelectorAll('.elements').
You can however do:
document.querySelectorAll('a').forEach(a => a.style.color = 'red')
- MarkLowenstein 5y agoThis is the only post that I see so far that touches on the real innovation and unique value of jQuery: operating on groups. Everybody can go ahead and tell me that using a forEach every time is trivial, or that I can just insert some transpiler step in my build pipeline to take advantage of X language's convenient syntax, but the bottom line is that people use jQuery because it continues to be easier. Thank you for your insight and great design sense John Resig! Still not bested after 15 years.