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

insertAdjacentHTML Method

Internet Development Index

Inserts the given HTML text into the element at the location.

Syntax

object.insertAdjacentHTML(sWhere, sText)

Parameters

sWhere Required. String爐hat specifies where to insert the HTML text, using one of the following values:
beforeBeginInserts sText immediately before the object.
afterBeginInserts sText after the start of the object but before all other content in the object.
beforeEndInserts sText immediately before the end of the object but after all other content in the object.
afterEndInserts sText immediately after the end of the object.
sText Required. String爐hat specifies the HTML text to insert. The string can be a combination of text and HTML tags. This must be well-formed, valid HTML or this method will fail.

Return Value

No return value.

Remarks

If the text contains HTML tags, the method parses and formats the text as it is inserted.

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

When using the insertAdjacentHTML method to insert script, you must include the DEFER attribute in the script element.

Example

This example uses the insertAdjacentHTML method to insert script into the page.

var sHTML="<input type=button onclick=" +
"go2()" + " value='Click Me'><BR>"
var sScript='<SCRIPT DEFER>'
sScript = sScript +
'function go2(){ alert("Hello from inserted script.") }'
sScript = sScript + '</script' + '>';
ScriptDiv.insertAdjacentHTML("afterBegin",sHTML + sScript);
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this method.

Applies To

A, ADDRESS, AREA, B, BASEFONT, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COMMENT, CUSTOM, DD, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FONT, FORM, FRAMESET, hn, HR, 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, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARQUEE, MENU, NOBR, OL, OPTION, P, PLAINTEXT, PRE, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TD, TEXTAREA, TH, TT, U, UL, VAR, XMP

See Also

innerHTML, insertAdjacentText, outerHTML
临安市| 商都县| 洛川县| 南宁市| 沙湾县| 长春市| 新巴尔虎右旗| 霍城县| 天水市| 宁阳县| 靖边县| 洛川县| 恩施市| 伊春市| 五寨县| 贺兰县| 东兰县| 思南县| 仙游县| 增城市| 额尔古纳市| 收藏| 南岸区| 缙云县| 如皋市| 安多县| 富裕县| 桂平市| 平乡县| 嘉黎县| 舒兰市| 灵宝市| 阿克苏市| 乐陵市| 凤台县| 定安县| 库尔勒市| 姜堰市| 神农架林区| 烟台市| 周口市|