469,288 Members | 2,353 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,288 developers. It's quick & easy.

display title when tag got focus

KS
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?
Jul 23 '05 #1
1 5233
"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>
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jon W | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.