W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2016

Re: .getElementsByName()

From: Anne van Kesteren <annevk@annevk.nl>
Date: Fri, 8 Apr 2016 04:28:20 +0200
Message-ID: <CADnb78i9yTfuCTA5YTwEmUHtiAYQL=j=f=FNDq=VvOeh9L7P8A@mail.gmail.com>
To: Veli Senol <senol.veli@gmail.com>
Cc: "www-dom@w3.org" <www-dom@w3.org>
On Mon, Apr 4, 2016 at 12:14 PM, Veli Senol <senol.veli@gmail.com> wrote:
> this from the spec:
> Note: Elements is the better solution for representing a collection of
> elements. HTMLCollection is an historical artifact we cannot rid the web of.
>
> what does that mean in fact?
> Does it mean:
>
> document.getElementsByTagName('p')[0] is the better way than using
> var paras = document.getElementsByTagName('p');
> paras[0];

I recommend reading the DOM Standard instead:
https://dom.spec.whatwg.org/. What you're reading is not being
maintained.


-- 
https://annevankesteren.nl/
Received on Friday, 8 April 2016 02:28:46 UTC

This archive was generated by hypermail 2.3.1 : Friday, 8 April 2016 02:28:48 UTC