Apr 23, 2002 #1 MRALC IS-IT--Management Feb 21, 2002 8 GB I am trying to do a mouseover so when you put a cursor over one cell it change the bgcolor of another cell it the table. Al
I am trying to do a mouseover so when you put a cursor over one cell it change the bgcolor of another cell it the table. Al
Apr 23, 2002 #2 xutopia Programmer Apr 4, 2002 2,001 CA Try using an id for the cell you want to change : <style> .onClass { color : white ; background-color : Teal ; } .offClass { color: white ; background-color : Purple ; } </style> <script> function getElement(id) { return document.all ? document.all[id] : document.getElementById(id) ; } </script> <table> <tr> <td id=one onMouseOver="getElement('two').className = 'onClass'" onMouseOut="getElement('two').className = 'offClass'" class=offClass>Second</td> <td id=two onMouseOver="getElement('three').className = 'onClass'" onMouseOut="getElement('three').className = 'offClass'" class=offClass>Third</td> <td id=three onMouseOver="getElement('one').className = 'onClass'" onMouseOut="getElement('one').className = 'offClass'" class=offClass>First</td> </tr> </table> Hope this helps. Gary http://www.xutopia.com Haran Upvote 0 Downvote
Try using an id for the cell you want to change : <style> .onClass { color : white ; background-color : Teal ; } .offClass { color: white ; background-color : Purple ; } </style> <script> function getElement(id) { return document.all ? document.all[id] : document.getElementById(id) ; } </script> <table> <tr> <td id=one onMouseOver="getElement('two').className = 'onClass'" onMouseOut="getElement('two').className = 'offClass'" class=offClass>Second</td> <td id=two onMouseOver="getElement('three').className = 'onClass'" onMouseOut="getElement('three').className = 'offClass'" class=offClass>Third</td> <td id=three onMouseOver="getElement('one').className = 'onClass'" onMouseOut="getElement('one').className = 'offClass'" class=offClass>First</td> </tr> </table> Hope this helps. Gary http://www.xutopia.com Haran