CD-198 Part VI . Appendixes Notice that there (Make my own web site)

CD-198 Part VI . Appendixes Notice that there is no space after the exclamation mark of the inserted HTML. But to prove that the inserted HTML is genuinely part of the document s object model, you can now insert the text of a space after the B element whose ID is myB: myB.insertAdjacentText( afterEnd , ) Each time you evaluate the preceding statement (by repeatedly clicking the Evaluate button or pressing Enter with the cursor in the topmost field), an additional space is added. You should also see what happens when the string to be inserted with insertAdjacentText() contains HTML tags. Reload The Evaluator and enter the following two statements into the topmost field, evaluating each one in turn: a = Important News! myP.insertAdjacentText( afterBegin , a) The HTML is not interpreted but is displayed as plain text. There is no object named myBafter executing this latest insert method. insertBefore(newChildNodeObject[, referenceChildNode]) NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility Example Listing 15-28 demonstrates how the insertBefore() method can insert child elements (LI) inside a parent (OL) at different locations, depending on the second parameter. A text box enables you to enter your choice of text and/or HTML for insertion at various locations within the OL element. If you don t specify a position, the second parameter of insertBefore()is passed as null meaning that the new child node is added to the end of the existing children. But choose a spot from the select list where you want to insert the new item. The value of each SELECT list option is an index of one of the first three child nodes of the OL element. Listing 15-28: Using the insertBefore() Method elementObject.insertBefore()
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Leave a Reply