Hacker News new | ask | show | jobs
by sillysaurusx 1666 days ago
What an awful design. Why would it differ like that? No doubt some legacy baggage that was later turned into a justification.
2 comments

These APIs didn’t all come out the same time, so they weren’t designed to differ.

Instead they decided against doing live node lists in future but couldn’t change how the older methods work as that would break websites. In the world of DOM/JS you can’t really make breaking changes.

https://humanwhocodes.com/blog/2010/09/28/why-is-getelements... Has more context

I'd actually expect the opposite just from the names. I'd expect a selector to select a "live" node, and getElement to get a static one.