Element.innerText (Property)

The inner text of a tag in the document.


JScript - 3.0
Internet Explorer - 4.0
Property/method value type:String primitive
JavaScript syntax:IEmyElement.innerText
IEmyElement.innerText = aString
Argument list:aStringText to replace the inner text

The HTML in between but not including the tags that define the element is extracted and any tags are removed. The resulting text is returned when this property is being read.

When the property is being written to, the start and end tags remain intact but everything between them is replaced with a text string. To place HTML tags between the tags, use the innerHTML property.

For some objects, this is equivalent to the text property that Netscape supports.

It is effectively the same as anElement.innerHTML as long as there is no mark-up on the text between the beginning and ending tags.

If you want to include the containing tags, then use the outerText or outerHTML properties instead.

You can assign new text to be displayed in the HTML element by using this property as an LValue.


See also:Anchor.text, Element object, Element.canHaveHTML, Element.innerHTML, Element.insertAdjacentHTML(), Element.outerHTML, Element.outerText

insert figure 0048