drunkpragrammer
佳悦
2016-05-22 08:23

为什么我的JS程序里的按钮按下去没反应!!!我用的是CHROME浏览器

 <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>
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答