HBCMS更多的中文手册参考:

outerHTML参数属性

DHTML文档教程

Sets or retrieves the object and its content in HTML.

dhtml语法

HTMLN/A
Scriptingobject.outerHTML [ = sHTML ]

DHTML可能的值

sHTMLString that specifies or receives content and HTML tags.

The property is read/write for all objects except the following, for which it is read-only: caption, col, colgroup, frameset, html, tbody, td, tfoot, th, thead, TR. The property has no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see about dynamic properties.

remarks

the property can be any valid string containing a combination of text and tags.

when the property is set, the given string completely replaces the object, including its start and end tags. if the string contains html tags, the string is parsed and formatted as it is placed into the document.

this property is accessible at run time as of microsoft® internet explorer 5. removing elements at run time, before the closing tag has been parsed, can prevent other areas of the document from rendering.

you can set this property only after the onload event fires on the window. when dynamically creating a tag using textrange, innerhtml, or outerhtml, use microsoft jscript® to create new events to handle the newly formed tags. microsoft visual basic® scripting edition (vbscript) is not supported.

you can change the value of the title element using the document.title property.

to change the contents of the table, tfoot, thead, and tr elements, use the table object model. for example, use the rowindex property or the rows collection to retrieve a reference to a specific table row. you can add or delete rows using the insertrow and deleterow methods. to retrieve a reference to a specific cell, use the cellindex property or the cells collection. you can add or delete rows using the insertcell and deletecell methods. to change the content of a particular cell, use the innerhtml property.

DHTML代码范例

This example uses the outerHTML property to copy an object, accompanying attributes, and children to a list when a user clicks one of the objects.

<SCRIPT>
function fnCopyHTML(){
var oWorkItem = event.srcElement;
if((oWorkItem.tagName != "UL") && (oWorkItem.tagName != "LI")){
alert("Adding " + oWorkItem.outerHTML + " to the list.");
oScratch.innerHTML += oWorkItem.outerHTML + "<BR>";
}
}
</SCRIPT>
<UL onclick = "fnCopyHTML()">
<LI><B>Bold text</B>
<LI><I>Italic text</I>
<LI><U>Underlined text</U>
<LI><STRIKE>Strikeout text</STRIKE>
</UL>
<P>
<DIV ID = "oScratch" >
</DIV>

是否符合公共标准

There is no public standard that applies to this property.

Applies To

A, ACRONYM, ADDRESS, APPLET, AREA, B, BDO, BGSOUND, BIG, BLOCKQUOTE, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, CUSTOM, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAMESET, hn, HR, HTML Comment, 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, LISTING, MAP, MARQUEE, MENU, nextID, NOBR, OBJECT, OL, P, PLAINTEXT, PRE, Q, RT, RUBY, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, WBR, XMP

更多语法参考

insertAdjacentHTML