Solved

mouseover <td> text color change

Posted on 2003-11-21
2
4,545 Views
Last Modified: 2012-06-21
I would like to know, how to make the text color change when mouseover the <td>, not the text ??

For background color change, I had wrote this and it works:

<td height="20" class="Menu" onMouseOver="this.bgColor='#66cccc';" onMouseOut="this.bgColor='#9999ff'">Menu</td>

is set the font color change also simple like this ??

Thx a lot,
sL

0
Comment
Question by:sLso
2 Comments
 
LVL 1

Accepted Solution

by:
paStiSSet earned 25 total points
ID: 9801503
using this, i have tested and it works correctly:

<td height="20" class="Menu" onMouseOver="this.bgColor='#66cccc'; this.style.color='#FFFFFF'" onMouseOut="this.bgColor='#9999ff'; this.style.color='#0000FF'">Menu</td>
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9801553
Just in case you want to use this in multiple places, you can use a stylesheet...

<html>
<head>
<style>
<!--
.over { background-color:#66cccc; color:#FF0000; }
.out  { background-color:#9999ff; color:#000000; }
-->
</style>
<script language="JavaScript">
<!--
   function chgcell(EL,color)
   {
      var cell=EL;
      cell.className=color;
   }
//-->
</script>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="20" class="Menu" onMouseOver="chgcell(this,'over')" onMouseOut="chgcell(this,'out')">Menu</td>
  </tr>
</table>
</body>
</html>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now