HTML DOM display 属性

定义和用法

display 属性设置元素如何显示。


语法

Object.style.display=value


Possible Values


实例


设置不显示元素

<html>

<head>

<script type="text/javascript">

function removeElement()

{

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

}

</script>

</head>

<body>


<h1>Hello</h1>


<p id="p1">This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.</p>


<input type="button" onclick="removeElement()"

value="Do not display paragraph" />


</body>

</html>


欢迎关注:Java程序员联盟(javalm)


相关文章
相关标签/搜索