Skip to Main Content
JavaScript: The Definitive Guide, Fourth Edition
book

JavaScript: The Definitive Guide, Fourth Edition

by David Flanagan
November 2001
Intermediate to advanced content levelIntermediate to advanced
936 pages
68h 43m
English
O'Reilly Media, Inc.
Content preview from JavaScript: The Definitive Guide, Fourth Edition

Name

HTMLElement — the superclass of all HTML elements

Availability

JavaScript 1.2

Synopsis

HTMLElement is the superclass of all classes that represent HTML elements. Therefore, HTMLElement objects are used in many contexts in client-side JavaScript and are available in all of the following ways:

document.images[i]
document.links[i]
document.anchors[i]
document.forms[i]
document.forms[i].elements[j]
document.elementName
document.formName.elementName
document.all[i]

Properties

all[] [IE 4]

The complete list of elements contained within this element, in source order. This property behaves exactly like the Document.all[] property. See the Document.all[] reference page.

children[] [IE 4]

The elements that are direct children of this element.

className [IE 4, Netscape 6]

A read/write string that specifies the value of the class attribute of an element. This property is used in conjunction with Cascading Style Sheets.

document [IE 4]

A reference to the containing Document object.

id [IE 4, Netscape 6]

A read/write string that specifies the value of the id attribute of an element. This property is used to assign a unique name to an element.

innerHTML [IE 4, Netscape 6]

A read/write string that specifies the HTML text that is contained within the element, not including the opening and closing tags of the element itself. Setting this property replaces the content of the element with the specified HTML text. Note that you cannot set this property while the document is loading.

innerText ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JavaScript: A Beginner's Guide, Fourth Edition, 4th Edition

JavaScript: A Beginner's Guide, Fourth Edition, 4th Edition

John Pollock
Coding with JavaScript For Dummies

Coding with JavaScript For Dummies

Chris Minnick, Eva Holland

Publisher Resources

ISBN: 0596000480Supplemental ContentCatalog PageErrata