HTML and CSS Reference
In-Depth Information
You've completed your initial work on the dynamic table of contents. By navigating
through the node tree, you created list items matching all the section headings in the
Constitution document. In the next session, you'll learn how to turn this ordered list into
a series of nested lists based on the levels of the different headings.
Session 14.1 Quick Check
1.
What property extracts the text from an element, ignoring any markup tags?
Provide answers for both the standard document object model and the IE
document object model.
2.
What are nodes? What objects of an HTML file do they represent?
3.
What property references the parent of a node?
4.
What object references the third child node of an object?
5.
What property would you use to reference child nodes that are elements?
6.
For an element node representing a
blockquote
element, what values are
returned by the
nodeType
,
nodeName
, and
nodeValue
properties?
7.
Provide a command to create a node containing the text string
U.S.
Constitution
. Store the node in the
docText
variable. Provide another com-
mand to create an
h2
element node, storing the node in the
mainTitle
vari-
able. Provide a command to append the
docText
variable to the
mainTitle
variable.
8.
The
elemArr
variable contains the following array:
var elemArr = [“H1”, “H2”, “H3”, “H4”, “H5”, “H6”];
Provide the value returned by the following expression:
elemArr.indexOf(“H4”);