document.ids

JavaScript 1.2+, Nav4+ Syntax

document.ids.idName
						

Description

The ids property is an associative array that contains IDs associated with Netscape style sheets. Using dot notation, idName specifies an ID associated with a style. The style sheet IDs are created within the <style> or <script> tags using JavaScript or HTML.

Note

When creating an ID, make sure the declaration appears before the new ID is used, because many HTML objects cannot be changed after they have been created in the document.

Note

If JavaScript dot notation is used when creating a new ID within <style> tags, document does not have to be specified.

Example

Listing 7.103 demonstrates three different ways to create style sheet IDs using JavaScript and HTML ...

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.