if (elem.getAttribute("hidden") != null){ //code if elem is hidden }
// Where el is the DOM element you'd like to test for visibility function isHidden(el) { var style = window.getComputedStyle(el); return (style.display === 'none') }