- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Fri, 28 Jun 2013 15:53:28 -0700
- To: Tim Streater <tim@clothears.org.uk>
- Cc: WHATWG <whatwg@lists.whatwg.org>, Zirak A <zirak@mail.com>
On Fri, Jun 28, 2013 at 3:20 PM, Tim Streater <tim@clothears.org.uk> wrote: >> 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. Assuming you know literally anything about CSS, yes, it is quite obvious that that's what you do. "#foo" is an id selector. If you don't know anything about CSS, I suggest learning at least the basics. Attempting to do JS work without knowledge of CSS's abilities will lead you to duplicate, badly, functionality already built into CSS. ~TJ
Received on Friday, 28 June 2013 22:54:11 UTC