To create simple tool tip for form events
by barkkathulla[ Edit ] 2013-03-20 10:02:45
To create simple tool tip for form events
Page design
(it contains div id named as tooltip)
js function
function theFocus(obj) {
var tooltip = document.getElementById("tooltip");
tooltip.innerHTML = obj.title;
tooltip.style.display = "block";
tooltip.style.top = obj.offsetTop - tooltip.offsetHeight + "px";
tooltip.style.left = obj.offsetLeft + "px";
}
function theBlur(obj) {
var tooltip = document.getElementById("tooltip");
tooltip.style.display = "none";
tooltip.style.top = "-9999px";
tooltip.style.left = "-9999px";
}
style
#tooltip {
position: absolute;
display: none;
border: 1px solid #999;
background-color: #ccc;
padding: 5px;
}