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";
精彩评论