A RetroSearch Logo

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

Search Query:

Showing content from http://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionElement/text below:

HTMLOptionElement: text property - Web APIs

HTMLOptionElement: text property

Baseline Widely available

The text property of the HTMLOptionElement represents the text inside the <option> element. This property represents the same information as Node.textContent.

Note: If the element has a label, the text inside the <option> is not visually rendered. In this case, the text property can still be used to set the content, but it will have no visible effect.

Value

A string.

Example
const optionElement = document.getElementById("exampleOption");
console.log(`Text property: ${optionElement.text}`);
optionElement.text = "Updated text";
Specifications Browser compatibility See also

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