"KS" <ka*****@hotmail.com> wrote in message
news:42********@news.broadpark.no...
If I have a button like this.
<input type="button" name="foo" value="HIT ME" title="HIT ME HARD" />
If I move the cursor over it the title get displayed.
I want the title to get displayed when the button get focus by keypress or
jusing the Tab button on the keyboard so it gets the focus.
Is this possible?
Will this help? Watch for word-wrap.
(Only tested under IE and FF.)
<html>
<head>
<title>HitMe.htm</title>
<script type="text/javascript">
function tooltips(s) {
(s != "") ? d = "block" : d = "none";
document.getElementById("tip").style.display = d;
document.getElementById("tip").innerHTML = s;
}
</script>
<style type="text/css">
..tooltip {
background-color: lightyellow;
border: 1px solid black;
display: none;
font-family: Arial;
font-size: 8pt;
left:60px;
position: relative;
text-align: center;
top:-10px;
width: 70px;
}
</style>
</head>
<body>
<form action="#">
<input type="button" name="foo" value="HIT ME" title="HIT ME HARD"
onfocus="tooltips('HIT ME HARD')" onblur="tooltips('')">
<span id="tip" class="tooltip"></span>
</form>
</body>
</html>