Add a tooltip to a div

user475685 picture user475685 · Aug 19, 2011 · Viewed 728k times · Source

I have a div tag like this:

<div>
  <label>Name</label>
  <input type="text"/>
</div>

How can I displaying a tooltip on :hover of the div, preferably with a fade in/out effect.

Answer

sscirrus picture sscirrus · Aug 19, 2011

For the basic tooltip, you want:

<div title="This is my tooltip">

For a fancier javascript version, you can look into:

https://jqueryhouse.com/best-jquery-tooltip-plugins/

The above link gives you 25 options for tooltips.