To check whether a div is visible or not in the layout , we can simply use the JQuery :visible selector.
Example : check if a div is visible state or not. #
<script>
$(document..ready(function(){
$("button").click(function(){
if($("p").is(":visible")){
alert("The paragraph is visible.");
} else{
alert("The paragraph is hidden.");
}
});
});
</script>
Try it Yourself »
Comments (0)