最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

replaceChild Method

Internet Development Index

Replaces an existing child element with a new child element.

What's New for Microsoft® Internet Explorer 6

This method now applies to the attribute object.

Syntax

oReplace = object.replaceChild(oNewNode, oChildNode)

Parameters

oNewNode Required. Object爐hat specifies the new element to be inserted into the document.
oChildNode Required. Object爐hat specifies the existing element to be replaced.

Return Value

Returns a reference to the object that is replaced.

Remarks

The node to be replaced must be an immediate child of the parent object. The new node must be created using the createElement method.

This property is accessible at run time. If elements are removed at run time, before the closing tag is parsed, areas of the document might not render.

Example

This example uses the replaceChild method to replace a bold element from a div with an italic element.

<HEAD>
<SCRIPT>
function replaceElement()
{
//The first child of the div is the bold element.
var oChild=Div1.children(0);
var sInnerHTML = oChild.innerHTML;
if (oChild.tagName=="B")
{
oNewChild=document.createElement("I");
Div1.replaceChild(oNewChild, oChild);
oNewChild.innerHTML=sInnerHTML
}
else
{
oNewChild=document.createElement("B");
Div1.replaceChild(oNewChild, oChild);
oNewChild.innerHTML=sInnerHTML
}
}
</SCRIPT>
</HEAD>
<BODY>
<DIV ID=Div1 onclick="replaceElement()">
Click anywhere in this sentence to toggle this <B>word</B>
between bold and italic.</DIV>
</BODY>

Standards Information

This method is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 Non-Microsoft link.

Applies To

A, ACRONYM, ADDRESS, attribute, B, BDO, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, DD, DEL, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FONT, FORM, FRAMESET, HEAD, hn, HTML, I, IFRAME, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, INS, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARQUEE, MENU, nextID, OL, OPTION, P, PLAINTEXT, PRE, Q, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP
闽清县| 临江市| 阿瓦提县| 曲水县| 工布江达县| 新邵县| 广昌县| 教育| 温泉县| 亚东县| 丹寨县| 永新县| 高邑县| 咸阳市| 鄱阳县| 洛隆县| 富源县| 巴里| 上饶县| 凯里市| 徐州市| 阳信县| 清苑县| 凤城市| 莲花县| 丹巴县| 黔西| 桑植县| 林口县| 当阳市| 清原| 瑞金市| 昌邑市| 长沙县| 察雅县| 沁水县| 渝中区| 霍林郭勒市| 资溪县| 泉州市| 淮南市|