这里演示查找当前控件最近的table代码:
<html>
<head>
<title>usually function</title>
</head>
<body>
<table name="name_table1">
<tr>
<td>table1</td>
</tr>
</table>
<table name="name_table2">
<tr>
<td>table2</td>
</tr>
</table>
<table name="name_table3">
<tr>
<td>table3</td>
</tr>
</table>
</body>
<html>
<script type="text/javascript" src="jquery-1.4.4.js"></script>
<script>
$(function(){
$("td").bind("click",function(){
//alert($(this).html());
alert($(this).closest("table").attr("name"));
});
});
</script>