471,616 Members | 1,159 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

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 5290
"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
reply views Thread by leo001 | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.