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

insertAdjacentElement Method

Internet Development Index

Inserts an element at the specified location.

Syntax

oElement = object.insertAdjacentElement(sWhere, oElement)

Parameters

sWhere Required. String爐hat specifies where to insert the HTML element, using one of the following values:
beforeBeginInserts oElement immediately before the object.
afterBeginInserts oElement after the start of the object but before all other content in the object.
beforeEndInserts oElement immediately before the end of the object but after all other content in the object.
afterEndInserts oElement immediately after the end of the object.
oElement Required. Object that specifies the element to be inserted adjacent to the object that invoked the insertAdjacentElement method.

Return Value

Returns an element object.

Remarks

You cannot insert text while the document is loading. Wait for the onload event before attempting to call this method.

If you try to insert an object that already exists on the page, the existing object will be moved to the point that you specified in the insertAdjacentElement method; no new object will be created.

Example

This example uses the insertAdjacentElement method to add a new list item to an ol object.

<SCRIPT>
function fnAdd()
{
var oNewItem = document.createElement("LI");
oList.children(0).insertAdjacentElement("BeforeBegin",oNewItem);
oNewItem.innerText = "List Item 0";
}
</SCRIPT>
:
<BODY>
<OL ID = "oList">
<LI>List Item 1</LI>
<LI>List Item 2</LI>
<LI>List Item 3</LI>
</OL>
<INPUT TYPE = "button" VALUE = "Add Item" onclick="fnAdd()">
</BODY>

Standards Information

There is no public standard that applies to this method.

Applies To

A, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BDO, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, FRAMESET, HEAD, hn, HR, HTML, I, IFRAME, IMG, 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, LINK, LISTING, MAP, MARQUEE, MENU, nextID, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, XMP
西青区| 富锦市| 洛南县| 伊川县| 庆阳市| 那曲县| 洪洞县| 呼和浩特市| 元谋县| 泸州市| 扶余县| 平罗县| 无棣县| 蕲春县| 沅陵县| 丽江市| 仁化县| 伊春市| 双辽市| 泸州市| 穆棱市| 保康县| 昭平县| 民县| 寿阳县| 新丰县| 昌黎县| 开江县| 乌拉特中旗| 桐柏县| 桦甸市| 孟连| 曲松县| 东海县| 东阳市| 禹城市| 南木林县| 山阴县| 柯坪县| 辽中县| 缙云县|