HTML DOM Element title attribute
- Previous Page textContent
- Next Page accessKey
- Go to Parent Level HTML DOM Elements Object
Definition and Usage
title
Attribute sets or returns the value of the element's title attribute.
title
The attribute can specify additional information about the element. When the mouse is over the element, it can be displayed as tooltip text.
See also:
Instance
Example 1
Get the element's title:
let title = element.title;
Example 2
Change the element's title:
element.title = "The World's Largest Web Development Site";
Syntax
Return the title attribute:
element.title
Set the title attribute:
element.title = text
attribute value
value | description |
---|---|
text | the value of the title attribute of the element. |
return value
type | description |
---|---|
string | the value of the title attribute of the element. |
browser support
All browsers support element.title
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page textContent
- Next Page accessKey
- Go to Parent Level HTML DOM Elements Object