Review of the Document Object Model (2)

The document you see at the right is also made of "spare parts", as follows:

  • Document
    • images [0] (French flag)
    • images [1] (Spanish flag)
    • Forms [0]
      • Elements[0] (input area 1)
      • Elements[1] (input area 2)
      • Elements[2] (button)
Screenshot of HTML page

Each of these parts also has properties which describe it, and methods, or things that it can do. In the case of the parts that make up your page, here's a brief list:

Object Properties Methods
image src (URL for image)
align (left, right, etc.)
(see below)
form action
target
submit()
reset()
input text element value
size
focus()

You may have noticed that the properties of these objects correspond nicely with the attributes of the <img>, <form>, or <input type="text"> tags.

Note: the img tag does have methods, but none that I care to mention in this brief review.
  DOM Review (1)  Index DOM Review (3)