228Part IIIDocument Objects ReferenceListing 15-10(continued) document.getElementById( myList ).replaceChild(newItem, firstLI); } (Web and email hosting)

228Part IIIDocument Objects ReferenceListing 15-10(continued) document.getElementById( myList ).replaceChild(newItem, firstLI); } function replaceLast(form) { var newItem = makeNewLI(form.input.value); var lastLI = document.getElementById( myList ).lastChild; document.getElementById( myList ).replaceChild(newItem, lastLI); }

firstChild and lastChild Property Lab






  1. Initial Item 1
  2. Initial Item 2
  3. Initial Item 3
  4. Initial Item 4

Related Items:nextSibling, parentElement, parentNode, previousSiblingproperties; appendChild(), hasChildNodes(), removeChild(), removeNode(), replaceChild(), replaceNode()methods. heightwidthValue:Integer or percentage string.Read/Write and Read-Only Compatibility:WinIE4+, MacIE4+, NN4+, Moz1+, Safari1+ The heightand widthproperties described here are not the identically named properties thatbelong to an element s style. Rather, these properties reflect the values normally assigned toheightand widthattributes of elements such as img, applet, table, and so on. As such, theseproperties are accessed directly from the object (for example, document.getElementById( myTable ).widthin IE4+) rather than through the styleobject (for example, document. getElementById( myDIV ).style.width). Only elements for which the HTML 4.xstandardprovides heightand widthattributes have the corresponding properties. elementObject.firstChild