display title when tag got focus

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • KS

    #1

    display title when tag got focus

    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?


  • McKirahan

    #2
    Re: display title when tag got focus

    "KS" <katos75@hotmai l.com> wrote in message
    news:4215f6c8$1 @news.broadpark .no...[color=blue]
    > 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?
    >[/color]

    Will this help? Watch for word-wrap.
    (Only tested under IE and FF.)

    <html>
    <head>
    <title>HitMe.ht m</title>
    <script type="text/javascript">
    function tooltips(s) {
    (s != "") ? d = "block" : d = "none";
    document.getEle mentById("tip") .style.display = d;
    document.getEle mentById("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="toolti ps('HIT ME HARD')" onblur="tooltip s('')">
    <span id="tip" class="tooltip" ></span>
    </form>
    </body>
    </html>


    Comment

    Working...