1. <script type="text/javascript" >   
  2. //   debugger;  
  3.    function RowColor(sRowID,sOrignalColor,sChangeColor)  
  4.    {  
  5.       this.rowID=sRowID;                 //传入行号  
  6.       this.orignalColor=sOrignalColor;   //原来的原色  
  7.       this.changeColor= sChangeColor;    //要变的原色       
  8.    }  
  9.    RowColor.prototype.replaceColor=function()  
  10.    {  
  11.        document.getElementById(this.rowID).style.backgroundColor=this.changeColor;  
  12.    }  
  13.    RowColor.prototype.resumeColor=function()  
  14.    {  
  15.        document.getElementById(this.rowID).style.backgroundColor=this.orignalColor;  
  16.    }  
  17.        
  18.    var Row1=new RowColor("row1","Red","Fuchsia");  
  19.    var Row2=new RowColor("row2","Yellow","Olive");  
  20.    var Row3=new RowColor("row3","Blue","Navy");  
  21.    var Row4=new RowColor("row4","Green","Lime");  
  22.    var Row5=new RowColor("row5","White","Silver");  
  23.    var Row6=new RowColor("row6","Black","Gray");  
  24.      
  25.       
  26. </script> 
Red Change To Fuchsia
Yellow Change To Olive
Blue Change To Navy
Green Change To Lime
White Change To Silver
Black Change To Gray