The following summarises the behaviour of HTMLCollection objects in browsers (looking specifically at HTMLDocument.links, HTMLDocument.images, HTMLDocument.embeds, HTMLDocument.forms, HTLMDocument.scripts and HTMLTableElement.rows).
IE8b2 | Fx3.0.4 | Op9.6 | Saf3.2 | Cr0.3 | |
---|---|---|---|---|---|
An index property exists for each matching element | yes | yes | yes | yes | yes |
A name property exists for an element with a "normal" name | yes3 | yes | yes | yes | yes |
A name property exists for an element with a name that looks like an index | no7 | no5 | no | yes8 | no |
Index properties are enumerable | no4 | yes | yes | yes | yes |
Name properties are enumerable | yes1 | no | yes1 | no | no |
Getting via a name property that matches multiple elements returns a single element | no2 | yes | no2 | no | no |
Getting via a name property that conflicts with an HTMLCollection operation returns the matching element | yes | no | yes | no | no |
Getting via a name property that conflicts with an HTMLCollection attribute returns the matching element | yes | no | no6 | no | no |
Getting via a name property that conflicts with a property on the Object prototype object returns the matching element | yes | no | yes | no | no |
Collection object [[HasProperty]] index property | yes | yes | yes | yes | yes |
Index property is on the collection object | yes | yes | no | yes | yes |
Collection object [[HasProperty]] name property | yes | no | yes | yes | yes |
Name property is on the collection object | yes | no | no | yes | yes |
The following summarises the behaviour of HTMLFormControlsCollection objects in browsers (just looking at HTMLFormElement.elements).
IE8b2 | Fx3.0.4 | Op9.6 | Saf3.2 | Cr0.3 | |
---|---|---|---|---|---|
An index property exists for each matching element | yes | yes | yes | yes | yes |
A name property exists for an element with a "normal" name | yes | yes | yes | yes | yes |
A name property exists for an element with a name that looks like an index | no7 | no5 | no | yes8 | no |
Index properties are enumerable | no | yes | yes | yes | yes |
Name properties are enumerable | yes1 | no | yes1 | no | no |
Getting via a name property that matches multiple elements returns a single element | no | no | no | no | no |
Getting via a name property that conflicts with an HTMLCollection operation returns the matching element | yes | no | yes | no | no |
Getting via a name property that conflicts with an HTMLCollection attribute returns the matching element | yes | no | yes | no | no |
Getting via a name property that conflicts with a property on the Object prototype object returns the matching element | yes | no | yes | no | no |
Collection object [[HasProperty]] index property | yes | yes | yes | yes | yes |
Index property is on the collection object | yes | yes | no | yes | yes |
Collection object [[HasProperty]] name property | yes | no | yes | yes | yes |
Name property is on the collection object | yes | no | no | yes | yes |
Notes: