New Revised CSS Library Forums Web Tools
FAQs Awards Usage Terms Contact


<script type="text/javascript">

* Highlight Table Cells Script- Dynamic Drive DHTML code library (
* Visit for hundreds of DHTML scripts
* This notice must stay intact for legal use

//Specify highlight behavior. "TD" to highlight table cells, "TR" to highlight the entire row:
var highlightbehavior="TD"

var ns6=document.getElementById&&!document.all
var ie=document.all

function changeto(e,highlightcolor){
source=ie? event.srcElement :
if (source.tagName=="TABLE")
while(source.tagName!=highlightbehavior && source.tagName!="HTML")
source=ns6? source.parentNode : source.parentElement
if (!=highlightcolor&&!="ignore")

function contains_ns6(master, slave) { //check if slave is contained by master
while (slave.parentNode)
if ((slave = slave.parentNode) == master)
return true;
return false;

function changeback(e,originalcolor){
if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||"ignore")||source.tagName=="TABLE")
else if (ns6&&(contains_ns6(source, e.relatedTarget)||"ignore"))
if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)


<table onMouseover="changeto(event, 'lightgreen')"
onMouseout="changeback(event, 'white')">
<td id="ignore">Main Menu</td>