?
Solved

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

Posted on 2008-06-11
1
Medium Priority
?
231 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

800 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