O'Reilly logo

Dynamic HTML: The Definitive Reference by Danny Goodman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required