How to make tooltip using Javascript?

Discussion in 'JavaScript' started by Hitul, Mar 25, 2007.

  1. #1
    Hi. I want to make a tooltip using javascript. Anyone knows how to make it? If yes then post your replies. Thank you in advance.
     
    Hitul, Mar 25, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    You only need to add a "title" attribute on your <a> HTML element. Fill that attribute with your desired text.
    Also you can use the overlib library to get cool efects
    .
     
    ajsa52, Mar 26, 2007 IP
  3. Hitul

    Hitul Peon

    Messages:
    76
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    what's the exact syntax of it?
     
    Hitul, Mar 26, 2007 IP
  4. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #4
    Example:

    
    <html>
    <head />
    <body>
      <a href="http://www.google.com" title="Link to Google">Google</a>
    </body>
    </html>
    
    Code (markup):
    Place your mouse over the link and after two seconds you'll see the tooltip appearing
    .
     
    ajsa52, Mar 26, 2007 IP
  5. Hitul

    Hitul Peon

    Messages:
    76
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thank you very much......
     
    Hitul, Mar 26, 2007 IP