Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change cell bgcolor 1

Status
Not open for further replies.

juanferman

Programmer
Nov 14, 2001
40
US
Hi guys,

Can anybody tell me how can I change the bgcolor of a cell.

i'm in other cell and when I put the mouse over I want to change the bgcolor of other cell.

It's urgent.

Thanks in advance ===================
::) Juan F. Sarria
 
<td onMouseOver=&quot;this.bgColor='red'&quot;>

hope it helps Suceess, thats the way you spell success!
Got a question? Ask IMOZRMY!
 
oh, and if you want to change it back to whatever it was:
<td onMouseOut=&quot;this.bgColor='white'&quot;> // white being
// whatever color it was Suceess, thats the way you spell success!
Got a question? Ask IMOZRMY!
 
I think this is what you're looking for:

<HTML>
<HEAD>
<TITLE>setBackgroundColor</TITLE>

<SCRIPT TYPE=&quot;text/javascript&quot;>
<!--
function setBackgroundColor(id,bgcolor){
document.getElementById(id).style.backgroundColor = bgcolor ;
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<table border=&quot;2&quot;>
<tr>
<td id=&quot;cell_1&quot; onmouseover=&quot;if(document.getElementById)setBackgroundColor('cell_2', '#FFEEDD')&quot;>Cell One</td>
<td id=&quot;cell_2&quot;>Cell Two</td>
</tr>
</table>



</BODY>
</HTML>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top