document.all

JScript 3.0+ IE 4+ Syntax

document.all[index]

Description

The document.all property is an array of all the HTML elements that are in the document. The elements appear in the array in the order in which they were created. Table 7.10 lists the methods associated with document.all array.

Table 7.10. Methods Associated with the document.all Array
Method Description
item() Returns an HTML element based on element's name
tags() Returns an array of elements that have the specified tag

Example

Listing 7.50 uses the document.all property array and array notation (brackets) to access the Paint anchor. Using dot notation, the name of the anchor is used to create a link to the top of the page.

Listing 7.50 Using document.all ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.