Quantcast

Re: .getElementsByName()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: .getElementsByName()

Veli Senol
hello,

this from the spec:
Note: Elements is the better solution for representing a collection of elementsHTMLCollection 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];


best regards

2016-03-29 16:17 GMT+02:00 Veli Senol <[hidden email]>:
hello,

please could you give me a pointer in which spec to search for .getElementsByName().


regards

Veli Senol

Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: .getElementsByName()

Anne van Kesteren-4
On Mon, Apr 4, 2016 at 12:14 PM, Veli Senol <[hidden email]> 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/

Loading...