asp.net.ph

Skip Navigation Links

outerHTML Property

DHTML Object Properties   DHTML Objects


Sets or retrieves the current object and its content in HTML.

Syntax


HTML N/A
Script object.outerHTML [ = sHTML ]

Possible Values


sHTML String containing content and HTML tags.

The property is read/write with no default value.

Remarks

The property can be any valid string containing a combination of text and tags, except for the HTML, HEAD, and TITLE tags.

When setting the property, 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.

The property cannot be set while the document is loading. Wait for the onload event before attempting to set it. If a tag is dynamically created using TextRange, innerHTML, or outerHTML, use JScript® ( compatible with ECMA-262 language specification ) to create new events to handle the newly formed tags. VBScript is not supported.

OuterHTML is read-only on the following objects: TBODY, TD, TFOOT, TH, THEAD, TR.

See Also

innerHTML, innerText, outerText



>

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note