innerText property
[This documentation is preliminary and is subject to change.]
Sets or retrieves the text between the start and end tags of the object.
Syntax
HRESULT value = object.put_innerText(BSTR v);HRESULT value = object.get_innerText(BSTR* p);
Property values
Type: BSTR
the text between the start and end tags.
Remarks
The IHTMLElement::innerText property is valid for block elements only. By definition, elements that do not have both an opening and closing tag cannot have an IHTMLElement::innerText property.
The IHTMLElement::innerText property is read-only on the html, table, tBody, tFoot, tHead, and tr objects.
When the IHTMLElement::innerText property is set, the given string completely replaces the existing content of the object.
You can set this property only after the HTMLFrameSiteEvents::onload event fires on the window. When dynamically creating a tag using TextRange, IHTMLElement::innerHTML, or IHTMLElement::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 IHTMLTableRow::rowIndex property or the rows collection to retrieve a reference to a specific table row. To retrieve a reference to a specific cell, use the IHTMLTableCell::cellIndex property or the cells collection. You can add or delete rows using the IHTMLTableRow::insertCell and IHTMLTableRow::deleteCell methods. To change the content of a particular cell, use the IHTMLElement::innerHTML property.
**Security Warning: ** Improper handling of the innerHTML property can enable script-injection attacks. When you accept text from an untrusted source (such as the query string of a URL), use createTextNode to convert the HTML to text, and use appendChild to append the element to the document using. Refer to the Examples section for more information.
To maintain compatibility with earlier versions of Windows Internet Explorer, this property applies to the textArea object. However, the property works only with strings that do not contain tags. With a string that contains a tag, this property returns an error. It is better to use the innerText property with this object.
See also
IHTMLElement::insertAdjacentText
Build date: 6/12/2012