Re: [whatwg] Proposal: Adding methods like getElementById and getElementsByTagName to DocumentFragments

On 28 Jun 2013 at 22:28, Zirak A <zirak@mail.com> wrote: 

> Because they may result in the same thing, but they have different semantic
> meanings. I want to get an element by its id, not run a CSS selector. I want
> to get elements by their tag names, not run a CSS selector.

Quite so.

> From: Tab Atkins Jr.

> Given that you have querySelector, why would you want the other
> functions? getElementById("foo") is just querySelector("#foo"),
> getElementsByTagName("foo") is just querySelectorAll("foo"), etc.

In addition it's hardly obvious that this is what you do.

--
Cheers  --  Tim

Received on Friday, 28 June 2013 22:20:59 UTC