<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>隔行变色</title> <script> window.onload = function () { var aLi = document.getElementsByTagName('li'); for (var i = 0; i < aLi.length; i++) { if…
//输入要隔行变色的标签名 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"; } }…
用JQuery实现表格隔行变色和突出显示当前行 上源码 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html> <head> <meta http-equiv="Content-Type" content="text/html; chars…