Common Object Properties, Methods, and Collections

The document object model implemented in Internet Explorer 4 and, to a lesser extent, the DOM working draft, exposes a wide range of properties, methods, and collections almost universally across objects that reflect HTML elements. Rather than repeat the descriptions of these items ad nauseam in the reference listing, I am listing their details here only once. Throughout the rest of the chapter, the property, method, and collection lists for each object point to these common items when the item name is in italic. When you see an item name listed in italic, it means you should look to this section for specific details about the item. If you recognize a term from the list of items in common, but it is not shown in italic, it means there is some object-specific information about the item, so the description is provided with the object.

In the following item descriptions, the example code uses the term elementID to refer to the identifier assigned to the ID attribute of the element. In your scripts, substitute the object’s true ID for the placeholder used here. Here is a list of the common items:

Properties

className

isTextEdit

offsetLeft

outerHTML

sourceIndex

document

lang

offsetParent

outerText

style

id

language

offsetTop

parentElement

tagName

innerHTML

offsetHeight

offsetWidth

parentTextEdit

title

innerText

    

Methods

click( )

insertAdjacentHTML( )

scrollIntoView( ...

Get Dynamic HTML: The Definitive Reference 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.