代码如下:<table>
<tr>
<td><a href="javascript:test(this);">click here</a></td>
</tr>
</table>怎么样才能在test()里访问到td or tr? this变成了window对象了.邀请不能给a添加id的
<tr>
<td><a href="javascript:test(this);">click here</a></td>
</tr>
</table>怎么样才能在test()里访问到td or tr? this变成了window对象了.邀请不能给a添加id的
<table>
<tr>
<td><a href="javascript:void(0);" onclick="test(this);">click here</a></td>
</tr>
</table>
这样就可以用this了。