Quick Search:
 
 JavaScript: Highlight table rows on rollover Jump to:  
Category: >> JavaScript >> Highlight table rows on rollover  

<< lastnext >>

Snippet Name: Highlight table rows on rollover

Description: Easy way to make table rows change color (highlight) when the cursor is moved over them.

Comment: (none)

Language: JAVASCRIPT
Highlight Mode: JAVASCRIPT
Last Modified: February 27th, 2009

<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>


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org