js processing table1. Row color interval displaycss style: two selectors Copy code The code is as follows: <br>.one{ <br>background-color:#33ffcc; <br>} <br>.two { <br>backgound-color:#ffff66; <br>} <br> <br>function trcolor() <br>// Control the color display of interval rows<br>{ <br>var tabNode = document.getElementsByTagName("table")[0]; <br>//Get table nodes<br>var trs = tabNode.rows; <br>/ / Get all the rows in the table <br>for(var x=1; x<trs.length;x ) <BR>{ <BR>if(x%2 == 1) <BR>trs[x]. className ="one"; <BR>else <BR>trs[x].className ="two"; <BR>} <BR>} <br><br>//Through the onload method, after the web page is loaded, Run the trcolor method to realize the color of the interval rows of the table. <BR>window.onload = function() <BR>{ <BR>trcolor(); <BR>} <BR> 2. Move the mouse to a certain line, Change the color to highlight, and restore the original color after moving it Copy the code The code is as follows: < ;style type="text/css"> .over{ background-color:##00ff00; } <br><br><script type= "text/javascript"> <br>var name; <br>function trMouse() <br>{ <br>var tabNode = document.getELementsByTagName("table")[0]; <br>//Through the for loop , add onmouseover and onmouseout attributes to each tr tag <br>for(var x=0;x<trs[x].length;x ) <BR>{ <BR>trs[x].onmouseover = function() <BR>{ <BR>name=this.className; <BR>this.className="over"; <BR>} <BR>tes[x].onmouseout = function() <BR>{ <BR>this. className = name; <BR>} <BR>} <BR>} <BR></script> <br> </div>