Solved

How to change the color of text elsewhere on page on rollover

Posted on 2008-06-11
1
228 Views
Last Modified: 2013-12-25
I am trying to do something on an .asp based page.  I have a line of text that, when I roll over it, I would like to have change the color of a word elsewhere on my page.  Is this hard to do?  Can someone show me how this is done?

Ideally I would like to do something like this ... http://www.siegelgale.com/expertise/ ... but I can settle for just changing the color if that is a bit too tricky.

Thanks!
0
Comment
Question by:TheShaner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
CoyotesIT earned 500 total points
ID: 21761870
You can try something like this here. You will need to be able to reference the id of the text, which i've assigned to the <span> tag of the text that changes color.

Hope this helps.



<html>
<head>
 
<script type="text/javascript">
	function changeColor(id, color) {
		document.getElementById(id).style.color = color;
	}
</script>
 
</head>
 
<body>
<p>
<span onmouseover="changeColor('changemycolor', 'red');" onmouseout="changeColor('changemycolor', 'black');">Roll over Me!</span>
</p>
 
<p>
Some filler text, Some filler text, Some filler text, Some filler text, Some filler text, Some filler text, 
</p>
 
<p>
<span id="changemycolor">Roll over that text up there to see me change color</span>
</p>
 
</body>
 
</html>

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question