X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM title Property

HTMLElement Object Reference Element Object

Example

Ge the title of an <abbr> element:

var x = document.getElementById("myAbbr").title;

The result of x will be:

World Health Organization

Try it yourself »

More "Try it Yourself" examples below.


Definition and Usage

The title property sets or returns the value of the title attribute of an element.

The title attribute specifies extra information about an element.

The information is most often shown as a tooltip text when the mouse moves over the element.


Browser Support

Property
title Yes Yes Yes Yes Yes


Syntax

Return the title property:

HTMLElementObject.title

Set the title property:

HTMLElementObject.title=text

Property Values

Value Description
text A tooltip text for an element

Technical Details

Return Value: A String, representing the title of the element


Examples

More Examples

Example

Change the title of a <p> element:

document.getElementById("myP").title = "The World's Largest Web Development Site";

Try it yourself »


Related Pages

HTML reference: HTML title Attribute


HTMLElement Object Reference Element Object


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook