2012年5月24日 星期四

[HTML][Javascript] Hide text with display property && Hide text with visibility property

Hide text with display property && Hide text with visibility property

<html>

<head>

<script type="text/javascript">

function demoDisplay()

{

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

}



function demoVisibility()

{

document.getElementById("p2").style.visibility="hidden";

}

</script>

</head>

<body>



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

<p id="p2">This is some text.</p>



<input type="button" onclick="demoDisplay()" value="Hide text with display property" />

<input type="button" onclick="demoVisibility()" value="Hide text with visibility property" />



</body>

</html>

Related Posts:

0 意見:

張貼留言