1个回答
展开全部
<html>
<head>
<meta charset="utf-8" />
<title>yu.html</title>
<script type="text/javascript">
window.onload = function ()
{
var cks = !!document.querySelectorAll
? document.querySelectorAll ("input[type='checkbox']")
: document.getElementsByTagName ("input");
for ( var i = 0; i < cks.length; i++)
{
if (cks[i].getAttribute ('type') == 'checkbox')
{
cks[i].onclick = function ()
{
if (this.checked)
{
alert (this.parentElement.parentElement.cells[2].innerHTML);
}
}
}
}
}
</script>
</head>
<body>
<table>
<tr>
<td><input type="checkbox" /></td>
<td>name</td>
<td>满意</td>
<td>天津</td>
<td>打仗</td>
<td>11</td>
<td>2year</td>
<td>2014</td>
</tr>
<tr>
<td><input type="checkbox" /></td>
<td>dddd</td>
<td>不满意</td>
<td>北京</td>
<td>沃什</td>
<td>222</td>
<td>12year</td>
<td>2017</td>
</tr>
</table>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询