To create simple tool tip for form events

by barkkathulla 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;
}
1229
like
0
dislike
0
mail
flag

You must LOGIN to add comments