Re: .getElementsByName()

Veli Senol <[email protected]> Mon, 4 Apr 2016 12:14:07 +0200
Newsgroups gmane.comp.web.dom.general
Message-ID <CAOH6sZ6REuHP7SMh4BdV8YppJ-oiC_5YdzFy9tfOaGMXSbsJFA@mail.gmail.com>
--089e0122e7202cc2f4052fa5fd98
Content-Type: text/plain; charset=UTF-8

hello,

this from the spec:
Note: Elements is the better solution for representing a collection
<https://www.w3.org/TR/dom/#concept-collection> of elements
<https://www.w3.org/TR/dom/#concept-element>. HTMLCollection
<https://www.w3.org/TR/dom/#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];


best regards

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

> hello,
>
> please could you give me a pointer in which spec to search for
> .getElementsByName().
>
>
> regards
>
> Veli Senol
>

--089e0122e7202cc2f4052fa5fd98
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">hello,<div><br></div><div>this from the spec:</div><div><s=
pan style=3D"color:rgb(0,128,0);font-family:sans-serif,&#39;Droid Sans Fall=
back&#39;;font-size:medium;font-style:italic;font-weight:bold">Note:=C2=A0<=
/span><code style=3D"color:orangered;font-style:italic;font-weight:bold">El=
ements</code><span style=3D"color:rgb(0,128,0);font-family:sans-serif,&#39;=
Droid Sans Fallback&#39;;font-size:medium;font-style:italic;font-weight:bol=
d">=C2=A0is the better solution for representing a=C2=A0</span><a href=3D"h=
ttps://www.w3.org/TR/dom/#concept-collection" title=3D"concept-collection" =
style=3D"color:rgb(102,0,153);font-family:sans-serif,&#39;Droid Sans Fallba=
ck&#39;;font-size:medium;font-style:italic;font-weight:bold;background-imag=
e:initial;background-repeat:initial">collection</a><span style=3D"color:rgb=
(0,128,0);font-family:sans-serif,&#39;Droid Sans Fallback&#39;;font-size:me=
dium;font-style:italic;font-weight:bold">=C2=A0of=C2=A0</span><a href=3D"ht=
tps://www.w3.org/TR/dom/#concept-element" title=3D"concept-element" style=
=3D"color:rgb(102,0,153);font-family:sans-serif,&#39;Droid Sans Fallback&#3=
9;;font-size:medium;font-style:italic;font-weight:bold;background-image:ini=
tial;background-repeat:initial">elements</a><span style=3D"color:rgb(0,128,=
0);font-family:sans-serif,&#39;Droid Sans Fallback&#39;;font-size:medium;fo=
nt-style:italic;font-weight:bold">.=C2=A0</span><code style=3D"color:orange=
red;font-style:italic;font-weight:bold"><a href=3D"https://www.w3.org/TR/do=
m/#htmlcollection" style=3D"color:inherit;background:transparent">HTMLColle=
ction</a></code><span style=3D"color:rgb(0,128,0);font-family:sans-serif,&#=
39;Droid Sans Fallback&#39;;font-size:medium;font-style:italic;font-weight:=
bold">=C2=A0is an historical artifact we cannot rid the web of.</span></div=
><div><span style=3D"color:rgb(0,128,0);font-family:sans-serif,&#39;Droid S=
ans Fallback&#39;;font-size:medium;font-style:italic;font-weight:bold"><br>=
</span></div><div><span style=3D"font-family:sans-serif,&#39;Droid Sans Fal=
lback&#39;;font-size:medium;background-color:rgb(255,255,255)"><font color=
=3D"#000000">what does that mean in fact?</font></span></div><div><span sty=
le=3D"font-family:sans-serif,&#39;Droid Sans Fallback&#39;;font-size:medium=
;background-color:rgb(255,255,255)"><font color=3D"#000000">Does it mean:</=
font></span></div><div><span style=3D"font-family:sans-serif,&#39;Droid San=
s Fallback&#39;;font-size:medium;background-color:rgb(255,255,255)"><font c=
olor=3D"#000000"><br></font></span></div><div><span style=3D"font-family:sa=
ns-serif,&#39;Droid Sans Fallback&#39;;font-size:medium;background-color:rg=
b(255,255,255)"><font color=3D"#000000">document.getElementsByTagName(&#39;=
p&#39;)[0] is the better way than using</font></span></div><div><span style=
=3D"font-family:sans-serif,&#39;Droid Sans Fallback&#39;;font-size:medium;b=
ackground-color:rgb(255,255,255)"><font color=3D"#000000">var paras =3D=C2=
=A0</font></span><span style=3D"color:rgb(0,0,0);font-family:sans-serif,&#3=
9;Droid Sans Fallback&#39;;font-size:medium">document.getElementsByTagName(=
&#39;p&#39;);</span></div><div><span style=3D"color:rgb(0,0,0);font-family:=
sans-serif,&#39;Droid Sans Fallback&#39;;font-size:medium">paras[0];</span>=
</div><div><span style=3D"color:rgb(0,0,0);font-family:sans-serif,&#39;Droi=
d Sans Fallback&#39;;font-size:medium"><br></span></div><div><span style=3D=
"color:rgb(0,0,0);font-family:sans-serif,&#39;Droid Sans Fallback&#39;;font=
-size:medium"><br></span></div><div><span style=3D"color:rgb(0,0,0);font-fa=
mily:sans-serif,&#39;Droid Sans Fallback&#39;;font-size:medium">best regard=
s</span></div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quot=
e">2016-03-29 16:17 GMT+02:00 Veli Senol <span dir=3D"ltr">&lt;<a href=3D"m=
ailto:[email protected]" target=3D"_blank">[email protected]</a>&gt;<=
/span>:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bor=
der-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">hello,<div><br><=
/div><div>please could you give me a pointer in which spec to search for .g=
etElementsByName().</div><div><br></div><div><br></div><div>regards</div><s=
pan class=3D"HOEnZb"><font color=3D"#888888"><div><br></div><div>Veli Senol=
</div></font></span></div>
</blockquote></div><br></div>

--089e0122e7202cc2f4052fa5fd98--