I have a div tag as follows:
<html>
<head></head>
<body>
<div>
<label>Name</label>
<input type="text"/>
</div>
</body>
</html>
Now I want a simple javascript for displaying a tooltip on :hover the div. Can someone please help me out? The tooltip should also have a fade in/out effect.
The simplest way would be to set
position: relative
on the containing element andposition: absolute
on the tooltip element inside the container to make it float relative to the parent (containing element). For example:You can make tooltip using pure CSS.Try this one.Hope it should help you to solve your problem.
HTML
CSS
you can do it with simple css...
jsfiddle
here you can see the examplebelow css code for tooltip
You can also customise tooltip style. Please refer this link: http://jqueryui.com/tooltip/#custom-style
Simple most way to add tooltip to your div element.
Here's a simple tooltip implementation that keeps into account the position of your mouse as well as the height and width of your window :
(see also this Fiddle)