Return the visibility type of a <p> element:
alert(document.getElementById("myP").style.visibility);
<!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> <p id="demo"></p> <script> function myFunction() {/* ww w.j a v a2 s. c o m*/ document.getElementById("demo").innerHTML = document.getElementById("myP").style.visibility; } </script> </body> </html>