ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.1 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | http://www.jqueryfaqs.com/Articles/Check-if-div-is-visible-using-jQuery.aspx |
| Last Crawled | 2026-04-08 04:46:02 (4 days ago) |
| First Indexed | 2014-11-09 15:39:46 (11 years ago) |
| HTTP Status Code | 200 |
| Meta Title | Check if div is visible using jQuery |
| Meta Description | Here Mudassar Ahmed Khan has explained how to check whether a DIV control is visible or hidden using jQuery. |
| Meta Canonical | null |
| Boilerpipe Text | The below code snippet explains how to find whether element is hidden or visible i.e. its CSS is set to display = none or display = block respectively using jQuery
<
script
type
=
"text/javascript"
src
="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></
script
>
<
script
type
="text/javascript">
$(
"#demo"
).live(
"click"
,
function
() {
CheckElementVisibility(
"dvA"
);
CheckElementVisibility(
"dvB"
);
});
function
CheckElementVisibility(id) {
if
($(
"#"
+ id).is(
":hidden"
)) {
alert(id +
" is hidden."
);
}
else
{
alert(id +
" is visible."
);
}
}
</
script
>
<
div
id
=
"dvA">
A
</
div
>
<
div
id
=
"dvB"
style
=
"
display
:none">
B
</
div
>
<
input
type
=
"button"
id
=
"demo"
value
=
"Demo"
/>
Explanation:
In the above code snippet there are 2 DIV controls of which one (dvA) is visible while the other (dvB) has its CSS style set to
display
:none
. Also we have a button with ID
demo
to which we have bind jQuery click event handler. When the demo button is clicked the
CheckElementVisibility
function is called which finds whether the element is hidden or visible using the jQuery
is(
":hidden"
)
function which returns true if the element or control is hidden. |
| Markdown | Disclaimer
This site makes use of Cookies. Please refer [Privacy Policy](http://www.jqueryfaqs.com/PrivacyPolicy.aspx) for more details.
[Got it]() |
| Readable Markdown | The below code snippet explains how to find whether element is hidden or visible i.e. its CSS is set to display = none or display = block respectively using jQuery
\<script type \= "text/javascript" src\="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"\>\</script\>
\<script type\="text/javascript"\>
\$("\#demo").live("click", function () {
CheckElementVisibility("dvA");
CheckElementVisibility("dvB");
});
function CheckElementVisibility(id) {
if (\$("\#" + id).is(":hidden")) {
alert(id + " is hidden.");
} else {
alert(id + " is visible.");
}
}
\</script\>
\<div id \= "dvA"\>A\</div\>
\<div id \= "dvB" style \= "display:none"\>B\</div\>
\<input type \= "button" id \= "demo" value \= "Demo" /\>
**Explanation:**
In the above code snippet there are 2 DIV controls of which one (dvA) is visible while the other (dvB) has its CSS style set to display:none. Also we have a button with ID demo to which we have bind jQuery click event handler. When the demo button is clicked the CheckElementVisibility function is called which finds whether the element is hidden or visible using the jQuery is(":hidden") function which returns true if the element or control is hidden. |
| Shard | 130 (laksa) |
| Root Hash | 16429891552089998530 |
| Unparsed URL | com,jqueryfaqs!www,/Articles/Check-if-div-is-visible-using-jQuery.aspx h80 |