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/HTMLTitleElement/text below:

HTMLTitleElement: text property - Web APIs

HTMLTitleElement: text property

Baseline Widely available

The text property of the HTMLTitleElement interface represents the child text content of the document's title as a string. It contains the <title> element's content as text; if HTML tags are included within the <title> element, they are included as part of the string value rather than being parsed as HTML.

Setting a value for the text property replaces the entire text contents of the <title>.

Value

A string.

Examples

Consider the example below:

<!doctype html>
<html lang="en-US">
  <head>
    <title>
      Hello world! <span class="highlight">Isn't this wonderful</span> really?
    </title>
  </head>
  <body></body>
</html>
const title = document.querySelector("title");
console.log(title.text); // "Hello world! <span class="highlight">Isn't this wonderful</span> really?"
title.text = "Update the title";

As you can see, the span tag remained unparsed; the <title> element's contents were treated as plain text and returned exactly as they appear in the title element.

Specifications Browser compatibility

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