Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/427.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 浏览器故障还是什么?_Javascript_Html - Fatal编程技术网

Javascript 浏览器故障还是什么?

Javascript 浏览器故障还是什么?,javascript,html,Javascript,Html,我已经创建了以下代码 <script> function show() { document.getElementById("changetable").style.display = "initial"; } </script> <script> function hide() { document.getElementById("changetable").style.display

我已经创建了以下代码

<script>
    function show()
    {
        document.getElementById("changetable").style.display = "initial";
    }
</script>
<script>
    function hide()
    {
        document.getElementById("changetable").style.display = "none";
    }
</script>
<select>
    <option onclick="hide()">1</option>
    <option onclick="hide()">2</option>
    <option onclick="hide()">3</option>
</select>
<input name="convert" id="submitbutton" type="button" value="Convert" size="10" onclick="return show();"/>
<div id="changetable" style="display:none" align="center">
    <table width="526" height="140" border="0" cellpadding="1" cellspacing="3">
        <tr>
            <th>
                name:
            </th>
            <td>
                <input name="fname" type="text" />
            </td>
        </tr>
    </table>
</div>

函数show()
{
document.getElementById(“changetable”).style.display=“initial”;
}
函数hide()
{
document.getElementById(“changetable”).style.display=“无”;
}
1.
2.
3.
姓名:

一切都很好,除了我用谷歌浏览器显示它。该表将显示,但在单击选项值后无法隐藏。Mozilla和其他软件完全可以正常工作。有什么想法吗?

看来
show()
函数没有定义。

你没有关闭
div#changetable
我做了,忘了添加,很抱歉,你在复制和粘贴测试代码时怎么会引入这么多错误?@sevensacat忽略这个小错误,我更改了一点原始代码。回到原来的问题。呃,这是我的错误,我编辑了代码,但它仍然无法显示。在当前我更新了bin@Sean时,选项标签上的事件似乎被破坏了。它们没有“破坏”,选项上的onclick事件不在规范中,因此它们是不允许的。