日期:2014-05-16 浏览次数:21091 次
<!doctype html>
<html>
<head>
<meta charset="gb2312">
<title>无标题文档</title>
<script type="text/javascript" src="jquery1.7.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {
$("td").dblclick(function(e) {
if (!$(this).hasClass("active") && !$(this).hasClass("disable")){
$("td:contains('" + $(this).text() +"')").addClass("disable");
$(this).removeClass().addClass("active")
}
else if ($(this).hasClass("active")){
$("td:contains('" + $(this).text() +"')").removeClass();
}
});
});
</script>
<style type="text/css">
.active {color:red}
.disable {color:#999}
}
</style>
</head>
<body>
<table width="300" border="1">
<tr>
<th scope="row"> </th>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<th scope="row"> </th>
<td>1#</td>
<td>2#</td>
<td> </td>
<td>3#</td>
<td> </td>
</tr>
<tr>
<th scope="row"> </th>
<td>1#</td>
<td> </td>
<td> </td>
<td>3#</td>
<td> </td>
</tr>
<tr>
<th scope="row"> </th>
<td>1#</td>
<td>3#</td>
<td>1#</td>
<td>1#</td>
<td> </td>
</tr>
<tr>
<th scope="row"> </th>
<td>3#</td>
&