You are here: Reference > JavaScript > client-side > HTML DOM > properties > title (document, XMLDocument)

title property (document, XMLDocument)

Browser support:
Sets or returns the title of the current document.
Sets or returns the contents of the title element placed in the head section.


You can find the related objects in the Supported by objects section below.
This property is read/write.

Possible values:

String that sets or retrieves the title.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the title property:
    <script type="text/javascript">
        function ChangeTitle () {
            document.title = "The new title of the document.";
    <button onclick="ChangeTitle ();">Change document title!</button>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content