How to find array of properties by data attribute JavaScript – best methods? or What’s the easiest wa

16 Replies, 1575 Views

Honestly, querySelectorAll is the go-to, but if you’re working with a huge DOM, maybe try `getElementsByClassName` with a shared class + data attr combo.

Not as elegant, but hey, performance wins sometimes.

Also, jsperf.com is great for testing speed differences.

Messages In This Thread



Users browsing this thread: 1 Guest(s)