Get the title of an element:
let title = element.title;
Try it Yourself »
Change the title of an element:
element.title = "The World's Largest Web Development Site";
Try it Yourself »
The title
property sets or returns the value of an element's title attribute.
The title attribute specifies extra information about an element. It can be shown as a tooltip text when the mouse moves over the element.
Return the title property:
element.title
Set the title property:
element.title =
text
Value | Description |
text | The value for the element's title attribute. |
Type | Description |
String | The value of the element's title attribute. |
element.title
is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!