开发者

How hide div in javascript?

<script type="text/javascript">开发者_运维知识库;
function HideDiv(id) {
    document.getElementById(id).Style.display = "block";
}
</script>


The correct syntax is element.style, not element.Style. "style" is a CSSStyleDeclaration object, "Style" is undefined. As such, for you, the code you need is:
document.getElementById(id).style.display = "none";
Helpful reference: http://www.w3schools.com/css/pr_class_display.asp


document.getElementById(id).style.display = "none";

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜