惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
GbyAI
GbyAI
S
SegmentFault 最新的问题
量子位
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
V
Visual Studio Blog
U
Unit 42
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
J
Java Code Geeks
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
IT之家
IT之家
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
雷峰网
雷峰网

博客园 - 威风剑

sqllite数据库操作帮助类 创建按钮的两种方法 jquery自定义事件 操作div - 威风剑 - 博客园 jQuery基本操作篇 jquery操作select时怎么产生事件 - 威风剑 - 博客园 jquery操作radio/checkbox/select 及其相关 - 威风剑 - 博客园 操作下拉框 - 威风剑 - 博客园 jquery操作select下拉列表框 - 威风剑 - 博客园 .NET SESSION的使用及原理 Ilist转换成dataset (转) DateTime.Now.ToString("yyyyMMddHHmmssfff") WebMethod 特性的 EnableSession Thread.Sleep(0) 【转】DataGridView新特色(vs2005) showModalDialog和showModelessDialog使用心得 Transact SQL 语 句 功 能 SQL语句 SQL语句
jqury操作表格 - 威风剑 - 博客园
威风剑 · 2009-05-13 · via 博客园 - 威风剑

<!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" />
<script src="jquery.js" type="text/javascript"></script>
<title>无标题文档</title>
<style type="text/css">
table{
border-collapse:collapse;
font-size:12px;
}

td {
border:1px solid #ccc;
padding-left:5px;
}
.alt {
background:#EFE;
}
.over {
background:#EEF;
}
.selected {
background:#0FF;
}
</style>
<script type="text/javascript">
<!--

$(document).ready ( function () {
$(".List tr:even").addClass("alt");
$(".List tr").mouseover(function () {$(this).addClass("over")}).mouseout(function () {$(this).removeClass("over")}).click(
function () {
   if ($(this).hasClass("selected"))
   {
    $(this).removeClass("selected");
    $(this).find("input[type='checkbox']").removeAttr("checked");
   }
   else
   {
    $(this).addClass("selected");
    $(this).find("input[type='checkbox']").attr("checked","true");
   }
   });

$("#All").click( function () {
   if ($("#All").attr("checked"))
   {
    $("input:checkbox[name='box']").attr("checked",true);
   }
   else
   {
    $("input:checkbox[name='box']").attr("checked",false);
   }
  
});
}
);
//-->
</script>
</head>

<body>

<form id="form1" name="form1" method="post" action="">
<table id="List" width="1026" height="156" cellpadding="0" cellspacing="0">
    <thead>
<tr>
   <td width="100" ><input type="checkbox" id="All" /><label for="All">全选</label></td>
      <td width="414" >标题</td>
      <td width="233">收件人</td>
      <td width="251">日期</td>
</tr>
    </thead>
<tbody class="List">
    <tr>
      <td width="50"><input type="checkbox" name="box" value="1" /></td>
      <td width="464">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><input type="checkbox" name="box" value="2" /></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><input type="checkbox" name="box" value="5" /></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
</tbody>
</table>
</form>
</body>
</html>