HTML DOM Element title attribute
- Forrige side textContent
- Næste side accessKey
- Gå tilbage til overfladen 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 over the element, it can be displayed as tooltip text.
See also:
Example
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 |
- Forrige side textContent
- Næste side accessKey
- Gå tilbage til overfladen HTML DOM Elements objekt