<html>
<head>
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</head>
<body><table id=tb>
<tr id=row>
<td id=col>11111</td>
</tr>
</table>
<script language=javascript>
document.getElementById("tb").rows(0).onclick = "alert(1);";
</script>
</body>
</html>
<head>
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</head>
<body><table id=tb>
<tr id=row>
<td id=col>11111</td>
</tr>
</table>
<script language=javascript>
document.getElementById("tb").rows(0).onclick = "alert(1);";
</script>
</body>
</html>
<head>
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</head>
<body><table id=tb>
<tr id=row onclick="alert('1')">
<td id=col>11111</td>
</tr>
</table>
</body>
</html>
<head>
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</head>
<body><table id=tb>
<tr id=row>
<td id=col>11111</td>
</tr>
</table>
<script language=javascript>
document.getElementById("tb").rows(0).onclick = function(){alert(1);};
</script>
</body>
</html>应该这样
onclick必须赋给一个函数的值:function(){alert(1);}
你那是字符串。