By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,695 Members | 1,597 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,695 IT Pros & Developers. It's quick & easy.

display title when tag got focus

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
"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.