CD-195Appendix F . (Web hosting faq) Examples from Parts III and

CD-195Appendix F . Examples from Parts III and IV document.body.getElementsByTagName( DIV ).length document.getElementById( myTable ).getElementsByTagName( TD ).length Because the getElementsByTagName() method returns an array of objects, you can use one of those returned values as a valid element reference: document.getElementsByTagName( FORM )[0].getElementsByTagName( INPUT ).length getExpression( attributeName ) NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility Example See Listing 15-32 for the setExpression()method. This listing demonstrates the kinds of values returned by getExpression(). hasChildNodes() NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility Example Use The Evaluator (Chapter 13) to experiment with the hasChildNodes() method. If you enter the following statement into the topmost text box: document.getElementById( myP ).hasChildNodes() the returned value is true. You can find out how many nodes there are by getting the length of the childNodes array: document.getElementById( myP ).childNodes.length This expression reveals a total of three nodes: the two text nodes and the EM element between them. Check out whether the first text node has any children: document.getElementById( myP ).childNodes[0].hasChildNodes() elementObject.hasChildNodes()
From our experience, we can recommend PHP5 Web Hosting services, if you need affordable webhost to host and run your web application.

Leave a Reply