Using Node Properties
This is basic XHTML document that contains various page elements. When the user clicks on the button at the top of the page. The function aboutNodes() is invoked. This function produces an alert box that displays the tagName of the element
myheading. Modify this function so that it
- Displays the text contained within the myheading element
(you will need to use the childNode and nodeValue properties of node objects)
- Displays the tag name of the nextSibling
- Displays the tag name of the parent node
Add an id attribute to the ul tag in this document
- Use the getElementById() a method of the document object to obtain a reference to this element
- Produce an alert box that tells the user the name of first item in the list