1个回答
展开全部
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<script type="text/javascript">
function getValue(){
var x=document.body.innerHTML;
//var text=x[0].firstChild.innerHTML;
//x[0].removeChild(text);
alert(x);
document.body.innerHTML='hello';
}
</script>
<body>
<div id='div'>
<input name='taozi' id = 'taozi1' type='checkbox' onClick='getValue()'>
<input name='taozi' id = 'taozi2' type='checkbox' onClick='getValue()'>
<input name='taozi' id = 'taozi3' type='checkbox' onClick='getValue()'>
</div>
<table>
<tr >
<td id ='123'>John</td>
<td>Doe</td>
<td>Alaska</td>
</tr>
</table>
</body>
</html>
这个是我刚写的,可以啊,拿出去保存下,看看可以不,然后再对照下自己的吧
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<script type="text/javascript">
function getValue(){
var x=document.body.innerHTML;
//var text=x[0].firstChild.innerHTML;
//x[0].removeChild(text);
alert(x);
document.body.innerHTML='hello';
}
</script>
<body>
<div id='div'>
<input name='taozi' id = 'taozi1' type='checkbox' onClick='getValue()'>
<input name='taozi' id = 'taozi2' type='checkbox' onClick='getValue()'>
<input name='taozi' id = 'taozi3' type='checkbox' onClick='getValue()'>
</div>
<table>
<tr >
<td id ='123'>John</td>
<td>Doe</td>
<td>Alaska</td>
</tr>
</table>
</body>
</html>
这个是我刚写的,可以啊,拿出去保存下,看看可以不,然后再对照下自己的吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询