Ask HN: Is assigning an ID to every HTML element bad practice?

1 points by ilmiont ↗ HN
I'm creating a single-page app in vanilla JS with a very small amount of jQuery, primarily for animation.

I'm currently using IDs in my JS views to select elements from the HTML, resulting in the majority of elements having an ID. I've developed a naming schema so this isn't getting too out of hand currently but I'm concerned about future ramifications. Is IDing virtually everything that could be selected considered an acceptable practice, or am I missing a cleaner and more efficient way to select elements?

0 comments

[ 0.24 ms ] story [ 7.7 ms ] thread

No comments yet.