1// Where el is the DOM element you'd like to test for visibility
2<script>
3 function isHidden(el) {
4 return (el.offsetParent === null);
5 }
6 var el = document.getElementById('el');
7 alert(isHidden(el));
8</script>
9// if true then element "el" is visible otherwise not visible