<html>
<head>
<title>
innerhtml
</title>
<script type="text/javascript">
function getinnerhtml()
{
alert(document.getElementsById("the1").innerHTML);
}
</script>
</head>
<body>
<table border="1">
<tr id="the1">
<th>drink</th>
<td>coffee</td>
<td>milk</td>
</tr>
</table>
<table border="5">
<tr id="the2">
<th>main food</th>
<td>noodles</td>
<td>rice</td>
</tr>
</table>
<input type="button" onclick="getinnerhtml()" value="please choose drink and food" />
</body>
</html>
为什么我的JS程序里的按钮按下去没反应!!!我用的是CHROME浏览器
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-