$(document).ready(function() {
$("tr").removeClass();
$("tr:gt(0)").click(function() {
$(this).css("color", "red")
});
});
.highlight td {
background: red;
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="003.css" type="text/css" rel="stylesheet" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<table>
<tr>
<td>NAME</td>
<td>AGE</td>
</tr>
<tr>
<td>John Smith</td>
<td>44</td>
</tr>
<tr>
<td>Mary Green</td>
<td>66</td>
</tr>
<tr>
<td>Bob Black</td>
<td>22</td>
</tr>
</table>
</body>
</html>
以下代码不起作用,但是如何纠正它?