JavaScript document title Property Tutorial

In this section, we will learn what the document title property is and how to use it in JavaScript.

What is document title Property in JavaScript?

The JavaScript document title property is used to set or get the title of an HTML document.

document title Property Syntax:

document.title;

document.title = new-value;

document title Property Input Value

If needed, we can set a new value for this property and that will be used as the new title of the document.

document title Property Return Value

The return value of this property is the current title of the document.

Example: using document title Property in JavaScript

See the Pen using document title Property in JavaScript by Omid Dehghan (@odchan1) on CodePen.

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies