W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2013

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

From: Tim Streater <tim@clothears.org.uk>
Date: 28 Jun 2013 23:20 +0100
To: Zirak A <zirak@mail.com>, Tab Atkins Jr. <jackalmage@gmail.com>
Message-Id: <20130628222035.8FE1D984302@zapata.dreamhost.com>
Cc: WHATWG <whatwg@lists.whatwg.org>
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

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:22 UTC