Answers for "javascript check if element is visible on screen"

0

javascript check if element is visible on screen

// Where el is the DOM element you'd like to test for visibility
<script>
  function isHidden(el) {
    return (el.offsetParent === null);
  }
  var el = document.getElementById('el');
  alert(isHidden(el));
</script>
// if true then element "el" is visible otherwise not visible
Posted by: Guest on May-05-2020

Code answers related to "javascript check if element is visible on screen"

Code answers related to "Javascript"

Browse Popular Code Answers by Language