<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>
getElementsById改成getElementById