A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/dom/HTMLElement/outerText below:

outerText · WebPlatform Docs

outerText

Property of dom/HTMLElementdom/HTMLElement

Syntax
var result = element.outerText;
element.outerText = value;
Examples

This example uses the outerText property to replace an object’s content; the object itself also is replaced.

<DIV ID=oDiv>
<P ID=oPara>Here's the text that will change.</P>
</DIV>
:
<BUTTON onclick="oPara.outerText='WOW!
    It changed!'">Change text</BUTTON>
<BUTTON onclick="oDiv.innerHTML='<P ID=oPara>
    And back again</P>'">Reset</BUTTON>

View live example

Notes Remarks

The outerText property is read-only on the html, tBody, td, tFoot, th, tHead, and tr objects. When this property is set, the given string completely replaces the original text in the object. 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 script 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 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.

Syntax Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4