【发布时间】:2012-12-12 09:40:49
【问题描述】:
我的 CSS:
#a_x200{
visibility: hidden;
width: 200px;
height: 200px;
background-color: black;
}
我的 JS:
<script type="text/javascript">
function show(id) {
document.getElementById(id).style.display = 'block';
}
</script>
我的 HTML
<div id="a_x200">asd</div>
<innput type="button" class="button_p_1" onclick="show('a_x200');"></input>
不工作,我想我错过了什么!
【问题讨论】:
-
您在 css 中设置
visibility,但在 js 中更改display加上一些语法错误... -
#a_x200{display:none;宽度:200 像素;高度:200 像素; background-color: black;} 还是不行
-
@PoWeR 你能在jsFiddle 中重现问题吗?
标签: javascript jquery html css