Re: .getElementsByName()

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