Home  >  Article  >  Web Front-end  >  JS controls table color change on alternate rows_JavaScript

JS controls table color change on alternate rows_JavaScript

WBOY
WBOYOriginal
2016-05-16 19:28:44829browse

    
        
    
    
    
        
    
    
        
    
    
        
    
    
        
    
    
    
        
    
不变色
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
不变色



<script><BR><!--<BR>var TbRow = document.getElementById("goaler");<BR>if (TbRow != null)<BR>{<BR> for (var i=0;i<TbRow.rows.length ;i++ )<BR> {<BR> if (TbRow.rows[i].rowIndex%2==1)<BR> {<BR> TbRow.rows[i].style.backgroundColor="";<BR> }<BR> else<BR> {<BR> TbRow.rows[i].style.backgroundColor="#F1F1F1";<BR> }<BR> }<BR>}<BR>//--><BR></script>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn