Wesley Aptekar-Cassels personal blog
GetElementById vs. QuerySelector
A while ago, I was curious how the speed of document.getElementById compared to document.querySelector in Javascript for selecting a single element by ID. querySelector has to do a lot more work, so one would expect that it would be slower, but I didn't know if the difference was enough to care about.
- Points
- 147
- HN comments
- 94
- Submissions
- 1
- Cited by
- 0 commenters
Web & FrontendSoftware Engineering2021
On Hacker News
| Submitted | Title on HN | Points | Comments |
|---|---|---|---|
| Nov 26, 2021 | GetElementById vs. QuerySelector by wesleyac | 147 | 94 |