简单隔行变色

   

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>简单选择器学习</title>
<script language="javascript" type="text/javascript" src="../../../include/jquery.js"></script>

<script language="javascript" type="text/javascript">

//使用jquery加载事件
$(document).ready(function (){
 
 $("tr:even").css("background","#ffff99");
 $("tr:odd").css("background","#cccccc");

});

 

 

</script>

 

</head>

<body>
<table width="600" border="1">
  <tr>
    <td>姓名</td>
    <td>性别</td>
    <td>年龄</td>
    <td>手机</td>
    <td>QQ</td>
  </tr>
  <tr>
    <td>哈哈</td>
    <td>女</td>
    <td>102</td>
    <td>13312344321</td>
    <td>12344321</td>
  </tr>
  <tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>
   <tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>
  <tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>

<tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>

<tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>

<tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>

<tr>
<td>哈哈</td>
<td>女</td>
<td>102</td>
<td>13312344321</td>
<td>12344321</td>
</tr>

</table>
</body>
</html>

阅读更多
上一篇jquery层次选择器
下一篇jquery克隆
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭