Page 177 - DCAP408_WEB_PROGRAMMING
P. 177
Unit 6: DOM Model
Hierarchy Notes
All objects on a web page are not created equal. Each exists in a set relationship with other
objects on the web page. From Figure (above figure), the navigator occupies the topmost slot in
the DOM followed by the Window object and so on.
Below the Window is the ‘Document’ object. Below the document object three other objects exist.
They are the ‘Anchor’, ‘Link’ and ‘Form’ objects. Individual form elements are found under the
‘Form’ object.
In addition to the DOM, other objects currently recognized by a JavaScript enabled browser are
Plug-ins, Applets and Images. Hence using a JavaScript enabled browser and JavaScript most of
major web page objects are accessible.
However, every single element of a web page rendered in the browser window, is not part of DOM.
Did u know? Is HTML tags part of the DOM?
HTML tags such as <HEAD></HEAD> or <BODY></BODY> are not part of the DOM.
Presentation styles, headings, body text, H1 to H6 and so on are not part of the DOM hence
and not recognized by JavaScript.
JavaScript, however, recognizes presentation styles, headings, body text, H1 to H6 and so on,
when JavaScript assisted Style Sheets (JSSS) are in a web page. JSSS is usually between the
<HEAD></HEAD> HTML tags in a web page.
6.1.1 The JavaScript Assisted Style Sheets DOM (JSSS DOM)
JSSS use JavaScript syntax to control a document’s presentation style. When a JSSS is embedded
in an HTML page within the <HEAD></HEAD> tags, then the JavaScript DOM picks up a whole
new set of objects, which add to the standard DOM objects already recognized by JavaScript.
The additional objects brought into the DOM by JSSS are shown in the figure below.
Figure 6.2
Document Tags
P
DIV
SPAN
H1 through H6
Classes Tag Names
ids
LOVELY PROFESSIONAL UNIVERSITY 171