Collections all and children
• Included arrays of related objects on a page The Dynamic HTML Object Model, includes a special collection, all. The all collection is a collection of all the XHTML elements in a document, in the order in which they appear. This provides an easy way of referring to any specific element, especially if it does not have an id.
• The script in iterates through the all collection and displays the list of XHTML elements on the page by writing to the innerHTML property of a p element.
• An element‘s style can be changed dynamically. Often such a change is made in response to user events. We refer to the background color as document. body.style.backgroundColor—the body property of the document object refers to the body element.
• XHTML elements can be positioned with scripting. This is done by declaring an element‘s CSS position property to be either absolute or relative, and then moving the element by manipulating any of the top, left, right or bottom CSS properties.
• vary the position of the element on the page by accessing its CSS left attribute, we use scripting to vary the color, fontFamily and fontSize attributes, and we use the element‘s innerHTML property to alter the content of the element.