Solved

mouseover <td> text color change

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Bootstrap on PLNKR 3 30
Link a VBS to an HTA 6 37
insert text field data into html script 13 42
Changing Two Areas of a Page 5 17
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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 …

803 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