TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

1 pointsby ilmiontalmost 9 years ago
I&#x27;m creating a single-page app in vanilla JS with a very small amount of jQuery, primarily for animation.<p>I&#x27;m currently using IDs in my JS views to select elements from the HTML, resulting in the majority of elements having an ID. I&#x27;ve developed a naming schema so this isn&#x27;t getting too out of hand currently but I&#x27;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?

no comments

no comments