Home »
JavaScript
HTML - Display Tooltip over a Button, Image, Link etc.
Here we will learn how to display tooltip whenever we move mouse on an object (i.e. display tooltip on mouse over event on any object in a webpage)?
In this example we are displaying three objects Button, Image and Link. There will be three different tooltips those will display when we move mouse on specific object.
If we move mouse on Button "This is an example button." Will display as a tooltip.
If we move mouse on Image "IncludeHelp's Logo" will display as a tooltip.
And if we move mouse on Link (Anchor tag) "IncludeHelp website link" will display as a tooltip.
HTML Code Snippet - Display Tooltip on Mouse Over on Button, Image or Link
Button Tooltip
<input type="button" value="Example" title="This is an example button."/>
Image Tooltip
<img src="../Images/ihelp1.png" title="IncludeHelp's Logo"/>
Link (Anchor) Tooltip
<a href="http://www.includehelp.com" title="IncludeHelp website link.">
IncludeHelp</a>
HTML Code
<!--HTML - Display Tooltip over a Button, Image, Link etc.-->
<html>
<head>
<title>HTML - Display Tooltip over a Button, Image, Link etc.</title>
<!--Example CSS-->
<link href="ExampleStyle.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<h1>HTML - Display Tooltip over a Button, Image, Link etc.</h1>
<h2>Move mouse on given object to display tooltip.</h2>
<input type="button" value="Example" title="This is an example button."/>
<br/>
<img src="../Images/ihelp1.png" title="IncludeHelp's Logo"/>
<br/>
<a href="http://www.includehelp.com" title="IncludeHelp website link.">IncludeHelp</a>
</body>
</html>
Result
Click for DEMO →