js check if element is visible code example
Example 1: check if element is visible
.is(':visible')
if($('#Div').is(':visible')){
}
$('#yourDiv:visible').callYourFunction();
Example 2: javascript check if element is visible on screen
<script>
function isHidden(el) {
return (el.offsetParent === null);
}
var el = document.getElementById('el');
alert(isHidden(el));
</script>
Example 3: to check element visible
if(driver.findElement(By.cssSelector("a > font")).isDisplayed())
{ System.out.println("Element is Visible");
}else{ System.out.println("Element is InVisible"); }