日期:2014-05-16 浏览次数:20497 次
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
function getVip(e){
alert(e.parentNode.parentNode.getElementsByTagName('td')[1].innerHTML+"-----");
alert(document.getElementById("tab").rows[e.parentNode.parentNode.rowIndex].cells[1].innerHTML+"*****");
}
</script>
</head>
<body>
<table id='tab'>
<tr>
<td>
1
</td>
<td>
vip01
</td>
<td>
<a href="javascript:;" onclick=getVip(this);>edit</a>
</td>
</tr>
<tr>
<td>
2
</td>
<td>
vip02
</td>
<td>
<a href="javascript:;" onclick=getVip(this);>edit</a>
</td>
</tr>
</table>
</body>
</html>