【问题标题】:Browser failure or what? [duplicate]浏览器故障还是什么? [复制]
【发布时间】:2015-12-09 07:44:54
【问题描述】:

我已经创建了以下代码

<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>

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

【问题讨论】:

  • 你没有关闭div#changetable
  • 我做了,抱歉忘了补充
  • 复制粘贴测试代码的时候怎么引入这么多bug?
  • @sevenseacat 忽略小错误,我更改了一些原始代码。回到原来的问题。

标签: javascript html


【解决方案1】:

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

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2015-11-16
  • 2013-06-10
  • 2013-10-22
  • 2013-05-31
  • 2013-01-16
  • 1970-01-01
  • 2017-02-18
  • 2013-06-26
相关资源
最近更新 更多