HtmlElement.OuterText Property

Definition

Gets or sets the current element's text.

public string OuterText { get; set; }

Property Value

The text inside the current element, and in the element's children.

Exceptions

You cannot set text outside of this element.

Remarks

If you attempt to assign HTML to an element with OuterText, the HTML code will display as literals in the document, just as if you were viewing HTML within a text file. If you assign HTML to an element using the InnerHtml property, OuterText will return all of the text in that HTML with the markup removed.

Assigning a value to OuterText will destroy any child elements that belong to the element.

Applies to

Продукт Версии
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also