Solved

mouseover <td> text color change

Posted on 2003-11-21
2
4,542 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

708 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

21 Experts available now in Live!

Get 1:1 Help Now