JS 一个简单的隔行变色函数
2024-10-21 03:33:46
//输入要隔行变色的标签名
function setbgColor(tr){
var tr = document.getElementsByTagName("tr");
for(var i = 1; i < tr.length ; i += 2){ // 从第二行开始遍历,i初始为1,递增2
tr[i].style.backgroundColor = "red";
}
}
最新文章
- UI-切圆角、透明度、取消按钮点击高亮效果、按钮文字带下划线
- javascript 基础
- ubuntu12.04安装WineQQ2012
- DBlink与同义词
- 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误的解决方法!
- 判断IE和Edge
- ckeditor+jsp+spring配置图片上传
- How to add “Maven Managed Dependencies” library in build path eclipse
- shuffle() 函数(转)
- POJ 1637 混合图欧拉回路
- 基于hash的文档判重——simhash
- oracle中nvl函数
- Linux 环境变量详解
- Iframe刷新页面
- Java一点输入输出技巧
- Moq 在.net Core 单元测试中的使用
- HTML- 标签语法
- java基础5 (一维)数组和二维数组
- struts 1.x 方法探析
- ActiveMQ与RabbitMQ的区别