Jump to content

[SOLVED] Trying to make one table td clicked change another tables td color


kts

Recommended Posts

Like the title says, im trying to click a td cell and change the other table's td cell bg color.

 

I have this page, and it didn't work out like I wanted.

 

www.ktshannon.com/test/test.html

 

here is code:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>click test</title>
<style type="text/css">
<!--
body {
background-color: #009900;
}

#tableblue {
background-color:#0066CC;
}

.eek { background-color:#FFFFFF; }

.over { background-color:#D0C0A9; padding-top: 2px; padding-bottom:2px;} 
.out { background-color: #009900; padding-top: 2px; padding-bottom:2px;} 

.over2 { background-color:#FF00FF; padding-top: 2px; padding-bottom:2px;}  
-->
</style></head>
<body>
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#FF0000">
  <tr>
    <td class="out" onMouseOver="this.className='over'" onMouseOut="this.className='out'" ><div id="eek" style="visibility:inherit;top:167px;left:650px;z-index:5;width:171;height:125"><img src="image2.gif" width="310" height="450"
     border="0" id="Picture24" /></a></div></td>
  </tr>
</table>
<table width="100" border="0">
  <tr>
    <td bgcolor="#FF00FF" onMouseOver="eek.className='over2'" onMouseOut="eek.className='out'"> </td>
    <td bgcolor="#00FFFF"> </td>
    <td bgcolor="#0000FF"> </td>
  </tr>
  <tr>
    <td bgcolor="#00FF00"> </td>
    <td bgcolor="#FFFF00"> </td>
    <td bgcolor="#FF0000"> </td>
  </tr>
  <tr>
    <td bgcolor="#666666"> </td>
    <td bgcolor="#000000"> </td>
    <td bgcolor="#FFFFFF"> </td>
  </tr>
</table>
<p><a href="#">click here to change the red to blue</a></p>
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.