The title attribute on a <button> tag adds a tooltip with title text to the button.
Hovering the mouse over the button will display the tooltip.
A title attribute on a <button> tag.
Hover over the button to see the tooltip.
<button type="button" title="Accept requested meeting."
onclick="alert('Meeting has been accepted!');">Accept</button>
The title attribute is placed in the <button> opening tag.
The value can be any string. Hover the cursor over the button and a tooltip appears.
The title attributes provides additional information about the <button> element.
The title attribute value can be seen as tooltip.
Tooltips are shown when the button element is hovered.
<button title="value">
Value | Description |
---|---|
value | A string value. A title can span multiple lines by including newline or carriage-return characters: or 
. |
Here is when title support started for each browser:
Chrome
|
1.0 | Sep 2008 |
Firefox
|
1.0 | Sep 2002 |
IE/Edge
|
1.0 | Aug 1995 |
Opera
|
1.0 | Jan 2006 |
Safari
|
1.0 | Jan 2003 |
Back to <button>