CD-196 Part VI . Appendixes The response is (Web hosting service)

CD-196 Part VI . Appendixes The response is false because text fragments do not have any nested nodes. But check out the EM element, which is the second child node of the myPelement: document.getElementById( myP ).childNodes[1].hasChildNodes() The answer is true because the EM element has a text fragment node nested within it. Sure enough, the statement document.getElementById( myP ).childNodes[1].childNodes.length yields a node count of 1. You can also go directly to the EM element in your references: document.getElementById( myEM ).hasChildNodes() document.getElementById( myEM ).childNodes.length If you want to see the properties of the text fragment node inside the EM element, enter the following into the lower text box: document.getElementById( myEM ).childNodes[0] You can see that the dataand nodeValue properties for the text fragment return the text all . insertAdjacentElement( location , elementObject) NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility Example Use The Evaluator (Chapter 13) to experiment with the insertAdjacentElement() method. The goal of the experiment is to insert a new H1 element above the myPelement. All actions require you to enter a sequence of statements in the topmost text box. Begin by storing a new element in the global variable a: a = document.createElement( H1 ) Give the new object some text: a.innerText = New Header elementObject.insertAdjacentElement()
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Leave a Reply