<input onfocus="show(this)" onblur="hide()"/>
<div id="div1" style="position:absolute;visibility:hidden;border:1px solid black">test</div>
<script language="JavaScript">
<!--
// 2005-3-3
// forbes pu
function getLeft(el) {
return el == null ? 0 : (el.offsetLeft + getLeft(el.offsetParent));
}
function getTop(el) {
return el == null ? 0 : (el.offsetTop + getTop(el.offsetParent));
}
function show(el) {
var x = getLeft(el);
var y = getTop(el);
with (document.getElementById("div1").style) {
left = x + 'px';
top = el.offsetHeight + y + 'px';
width = el.offsetWidth + 'px';
visibility = "visible";
}
}
function hide() {
document.getElementById("div1").style.visibility = "hidden";
}
//-->
</script>