Highlight Table Row on Mouse Over

Simple Javascript to highlight table rows on mouse over...
 

<script type="text/javascript">

function hiLiteRows(){
var x = document.getElementsByTagName('tr');
for (var i=0;i<x.length;i++)
{
x[i].onmouseover = function () {this.origColor=this.style.backgroundColor;
this.style.backgroundColor='#D8E5F2';
}
x[i].onmouseout = function () {this.style.backgroundColor=this.origColor;}
}
}

window.onload=hiLiteRows;

</script>

Bookmark and Share