CD-146 Part VI . Appendixes Example (Web site translator) You can

CD-146 Part VI . Appendixes Example You can try the following sequence of statements in the top text box of The Evaluator to see how the length property returns values (and sets them for some objects). Note that some statements work in only some browser versions. (All browsers) document.forms.length (All browsers) document.forms[0].elements.length (NN3+, IE4+) document.images.length (NN4+) document.layers.length (IE4+) document.all.length (IE5+, NN6) document.getElementById( myTable ).childNodes.length nextSibling previousSibling NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility Example The following function assigns the same class name to all child nodes of an element: function setAllChildClasses(parentElem, className) { var childElem = parentElem.firstChild while (childElem.nextSibling) { childElem.className = className childElem = childElem.nextSibling } } This example is certainly not the only way to achieve the same results. Using a for loop to iterate through the childNodes collection of the parent element is an equally valid approach. nodeName NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility elementObject.nodeName
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

Leave a Reply