Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9212435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:31:28+00:00 2026-06-18T01:31:28+00:00

I am fairly new with Javascript. Now, what I need is that I have

  • 0

I am fairly new with Javascript. Now, what I need is that I have a link in my projectXYZ which leads to another projectABC. I need to change the color of the link and show a tooltip dialog for the MouseOver event of the link.

I tried to change the color, but could not succeed with the tooltip. Is there a combined solution which fulfills these requirements ?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:31:29+00:00Added an answer on June 18, 2026 at 1:31 am

    Usually it is said to be sufficient to add a ‘title’ attribute in tour DIV’s and it will show up as tooltip on mouse-hover.

    But to make a basic tooltip with proper positioning, you can use the below. I have used it and it works !!

    JS (will have two mwthods, showTip and hideTip) :

    <script type="text/javascript">
    function showtip(e,message) {
    var x=0;
    var y=0;
    var m;
    var h;
    if(!e)
    var e=window.event;
    if(e.pageX||e.pageY) { x=e.pageX;  y=e.pageY;  }
    else if(e.clientX||e.clientY)
    { x=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;y=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}
    m=document.getElementById('myTooltip');
    if((y>10)&&(y<450))
    {  m.style.top=y-4+"px";  }
    else{  m.style.top=y+4+"px";  }
    var messageHeigth=(message.length/20)*10+25;
    if((e.clientY+messageHeigth)>510)
    {  m.style.top=y-messageHeigth+"px"; }
    if(x<850) { m.style.left=x+20+"px";  }
    else{  m.style.left=x-170+"px";  }
    m.innerHTML=message;m.style.display="block";m.style.zIndex=203;
    }
    
    function hidetip(){
    var m;
    m=document.getElementById('myTooltip');m.style.display="none";
    }
    </script>
    

    CSS:

    <style type="text/css">
    #myTooltip{padding: 5px; background-color: #FFF8DC;  border: 1px solid #DEB887; width:180px;font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #6b6b6b; display:none; position:absolute;left:0px;top:0px; }
    </style>
    

    And the HTML (will have an extra DIV below the href to show tooltip):

    <a href="javascript:void(0)" onmouseover="showtip(event, 'Sample tooltip text');"
    onmouseout="hidetip();">Hover mouse to see tooltip text.</a>
    <div id="myTooltip" ></div>
    

    Hope it helps !!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm fairly new to JavaScript/jQuery, but have made a script to change the background
I often have the need to search a javascript array that contains objects. I
Hi guys, I'm fairly new to javascript. I have a pretty simple script I
I am fairly new to AJAX I have a webpage (say webpage A) which
So I am fairly new to javascript. I would like to add a link
I'm fairly new to javascript and I'm trying to make an form for my
I fairly new to JQuery and perhaps trying to achieve something that might be
I am new to fairly new to AS3 and I have found myself needing
I'm fairly new to ruby and I've got a hash that looks like so:
I am fairly new to php and mysql but I have created a small

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.