HTML DOM Element title attribute
- Föregående sida textContent
- Nästa sida accessKey
- Åter till föregående nivå HTML DOM Elements-objekt
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 moved 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 web browsers support element.title
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Stöd | Stöd | Stöd | Stöd | Stöd | Stöd |
- Föregående sida textContent
- Nästa sida accessKey
- Åter till föregående nivå HTML DOM Elements-objekt