DOM

Methods

getElementById

Through the introduction to this lesson, we've found that we can manipulate any element in a document by referring to the element's position in a document's tree structure. That is advanced. We can also manipulate an element by calling its id alone. This is easier:

document.getElementById("id")

Actually, the element's own id would be set inside the quotation marks. Yes, DOM makes it so easy.

Next >


< Previous

[Page Top]

Introduction to DOM, by Dr Sam
copyright | contact
published by OxfordU.net

[An alternative, straight-text version is also available.]