Return the visibility type of a <p> element: - Javascript CSS Style Property

Javascript examples for CSS Style Property:visibility

Description

Return the visibility type of a <p> element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="myP" style="visibility:hidden;">This is a p element.</p>

<button type="button" onclick="myFunction()">Return the visibility type of p</button>

<script>
function myFunction() {//from ww  w  .j  av a2s.com
    console.log(document.getElementById("myP").style.visibility);
}
</script>

</body>
</html>

Related Tutorials