Re: .getElementsByName()
Anne van Kesteren <[email protected]> Fri, 8 Apr 2016 04:28:20 +0200
| Newsgroups | gmane.comp.web.dom.general |
|---|---|
| Message-ID | <CADnb78i9yTfuCTA5YTwEmUHtiAYQL=j=f=FNDq=VvOeh9L7P8A@mail.gmail.com> |
On Mon, Apr 4, 2016 at 12:14 PM, Veli Senol <[email protected]> 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/