{"id":4682,"date":"2024-09-27T07:18:25","date_gmt":"2024-09-27T07:18:25","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=4682"},"modified":"2024-09-27T08:55:52","modified_gmt":"2024-09-27T08:55:52","slug":"how-to-check-if-element-is-hidden-in-jquery","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/","title":{"rendered":"How to Check if Element is Hidden in JQuery"},"content":{"rendered":"\n<p>jQuery is a popular JavaScript library that allows web developers to easily work with different HTML elements on their site. In jQuery, a common task we face is to determine whether an element is hidden or visible. In this article, we will learn how to check if an element is visible or not. We will also learn how to display or hide or toggle element visibility.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#Check_if_Element_is_Hidden_in_JQuery\" >Check if Element is Hidden in JQuery<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#1_Using_hidden_selector\" >1. Using :hidden selector<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#2_Using_visible_selector\" >2. Using :visible selector<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#3_Using_css_function\" >3. Using css() function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#4_Using_filter_function\" >4. Using filter() function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#How_to_Hide_Element_in_jQuery\" >How to Hide Element in jQuery<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#How_to_Show_Element_in_jQuery\" >How to Show Element in jQuery<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#How_to_Toggle_Element_in_jQuery\" >How to Toggle Element in jQuery<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Check_if_Element_is_Hidden_in_JQuery\"><\/span>Check if Element is Hidden in JQuery<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are several ways to check if an element is hidden or visible. Let us look at some of the common solutions. Let us say you have the following couple of buttons on your web page. Out of them, the first one is hidden and the second is visible. We have used style HTML attribute to hide our element.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;button id='button1' class='my_buttons' style='display:none'&gt;Hello&lt;\/button&gt;<br>&lt;button id='button2' class='my_buttons'&gt;Bye&lt;\/button&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Using_hidden_selector\"><\/span>1. Using :hidden selector<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this solution, we will use is() function along with :hidden selector. is() function checks the state of an HTML element in jQuery, against the state provided. If element&#8217;s state matches the input state, then it returns true, else it returns false. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$(selector).is('state')<\/pre>\n\n\n\n<p>Here is the code to check if element is hidden, using jQuery.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$(selector).is(':hidden')<\/pre>\n\n\n\n<p>Here is the jQuery code to check if each of our buttons is hidden.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('#button1').is(':hidden'); \/\/output is true<br>$('#button2').is(':hidden'); \/\/output is false<\/pre>\n\n\n\n<p>Please note, the selector that you use for the above command must return only 1 item, else it will not work. is() function can check the state of only 1 element at a time. For example, if you use class selector &#8216;.my_buttons&#8217; which selects both the buttons, it will still return true, even though there are 2 buttons with same class name and the second one is visible.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('.my_buttons').is(':hidden'); \/\/output is true<\/pre>\n\n\n\n<p>In this case, since your selector returns multiple elements, you need to loop through each item and check their visibility individually. Here is an example to do this.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('.my_buttons').each(function(){<br>\talert($(this).is(':hidden'));<br>});<\/pre>\n\n\n\n<p>Please note, the is() function will check for CSS property display:none\/block and ignore visibility:true\/false.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Using_visible_selector\"><\/span>2. Using :visible selector<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Similarly, the :visible selector, when used with is() function, returns true if the element is visible. Else it returns false. Here is an example to check if our buttons are visible or not.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('#button1').is(':visible'); \/\/output is false<br>$('#button2').is(':visible'); \/\/output is true<\/pre>\n\n\n\n<p>Just like in the previous case, even :visible can be used with only one element at a time. If your element selector returns multiple elements, then it will return the state of only first element.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('.my_buttons').is(':visible'); \/\/output is false<\/pre>\n\n\n\n<p>In such cases, you need to loop through each element returned by the selector and separately check their visibility.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('.my_buttons').each(function(){<br>\talert($(this).is(':visible'));<br>});<\/pre>\n\n\n\n<p><strong>Please note<\/strong>, both :hidden and :visible also consider the visibility of the parent before returning true\/false values. If you do not want that to happen, use the next solution.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Using_css_function\"><\/span>3. Using css() function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>As mentioned earlier, :hidden and :visible only check for CSS property display:none\/block and not visibility:true\/false. If you want a more comprehensive way to check an element&#8217;s visibility then you can use css() function. It returns the value of any CSS property that you provide as function argument.<\/p>\n\n\n\n<p>Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$(selector).css(property) \/\/returns CSS property value<\/pre>\n\n\n\n<p>Here is the code to check if an element is hidden by checking both its display as well as visibility properties. We check that the display property should be none and the visibility property should be hidden. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">if ( $(selector).css('display') == 'none' || $(selector).css(\"visibility\") == \"hidden\"){<br>    \/\/ 'element' is hidden<br>}<\/pre>\n\n\n\n<p>Here is the code to check if the first button is hidden or not.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">if ( $('#button1').css('display') == 'none' || $('button1').css(\"visibility\") == \"hidden\"){<br>    \/\/ 'element' is hidden<br>}<\/pre>\n\n\n\n<p>If you need to check the visibility of multiple elements, or if your element selector returns multiple elements, then you need to loop through these elements one by one and separately check the visibility of each element. Here is an example to check visibility of each element with class=my_buttons<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('.my_buttons').each(function(){<br>\tif ( $(this).css('display') == 'none' || $(this).css(\"visibility\") == \"hidden\"){<br>    \/\/ element is hidden<br> }else{<br>    \/\/ element is visible<br>  }<br>});<\/pre>\n\n\n\n<p>Please note, the css() function does not consider the visibility of parent element, unlike is() method.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Using_filter_function\"><\/span>4. Using filter() function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Since is() and css() return values, you cannot chain any jQuery functions to it. However, in real world cases, people not only want to determine if an element is hidden or not but also do something with it. In such cases, you can use <a href=\"https:\/\/api.jquery.com\/filter\/\" target=\"_blank\" rel=\"noreferrer noopener\">filter()<\/a> function. It selects the elements based on the conditions and selectors you provide. It will identify hidden\/visible elements on your web page and allow you to chain functions to them, for further processing.<\/p>\n\n\n\n<p>For example, if you want to check if button1 is hidden using is() function and do something in case it is hidden, then you need to use the following code.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">if($('#button1').is(':hidden')){<br>  \/\/do something<br>}<\/pre>\n\n\n\n<p>But you can easily do this using filter() function as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('#button1').filter(\":hidden\").animate({ width: \"toggle\" });<\/pre>\n\n\n\n<p>You can also use it with selectors that return multiple elements. Here is an example where our class selector returns all buttons with class=my_buttons.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('<strong>.my_buttons<\/strong>').filter(\":hidden\").animate({ width: \"toggle\" });<\/pre>\n\n\n\n<p>So far, we have learnt how to determine if element is visible or hidden in jQuery. jQuery also provides hide(), show() and toggle() functions to hide, show or toggle elements. Irrespective of whether an element is hidden or not, you can directly show, hide or toggle its state using these functions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Hide_Element_in_jQuery\"><\/span>How to Hide Element in jQuery<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The hide() method allows you to hide one or more elements on a web page. It does so by setting its display CSS property to none. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$(selector).hide()<\/pre>\n\n\n\n<p>Here is an example to hide button with id=button2.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('#button2').hide()<\/pre>\n\n\n\n<p>Here is an example to hide all buttons with class=my_buttons.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('.my_buttons').hide();<\/pre>\n\n\n\n<p>You can also specify multiple selectors in a comma-separated format. Here is an example to hide buttons by specifying their IDs, instead of class name.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('#button1, #button2').hide();<\/pre>\n\n\n\n<p>If any of the selected elements are already hidden, they will continue to remain hidden, without getting affected.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Show_Element_in_jQuery\"><\/span>How to Show Element in jQuery<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Similarly, you can use show() function to display a hidden element. It does so by setting the display CSS property to block. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$(selector).show()<\/pre>\n\n\n\n<p>Here is an example to show button with id=button1.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('#button1').show()<\/pre>\n\n\n\n<p>Here is an example to show all buttons with class=my_buttons.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('.my_buttons').show()<\/pre>\n\n\n\n<p>Here also you can specify different selectors in a comma-separated manner.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('#button1, #button2').show();<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Toggle_Element_in_jQuery\"><\/span>How to Toggle Element in jQuery<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can also toggle the state of an HTML element, that is, from hidden to visible and vice versa using toggle() function. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$(element).toggle();<\/pre>\n\n\n\n<p>The toggle method will check if the selected element is visible and hide it. If it is hidden, then it will display the element. Here is the code to toggle the state of button1.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('#button1').toggle();<\/pre>\n\n\n\n<p>You can also call toggle() method on multiple elements. Here is the code to toggle state of all elements with class=my_buttons. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('.my_buttons').toggle()<\/pre>\n\n\n\n<p>In this case, it will display button1 and hide button2.<\/p>\n\n\n\n<p>Like hide() and show(), you can specify multiple selectors in a comma-separated manner.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$('#button1, #button2').toggle();<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt several ways to check if an element is hidden or visible using jQuery. You can easily do this using is() or css() functions. We have also learnt how to hide, show and toggle elements on your web pages. They work with almost every version of jQuery so you can use them as per your requirement. It is always a best practice to check if an element is hidden before you work with it, otherwise all the HTML changes will never be visible, since the element is hidden anyway.<\/p>\n\n\n\n<p>Also read:<\/p>\n\n\n\n<p><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-access-correct-this-inside-callback\/\">How to Access Correct This In JS Callback<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-return-response-from-asynchronous-call\/\">How to Return Asynchronous Response in JavaScript<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-bind-events-to-dynamically-created-elements-in-javascript\/\">How to Bind Events to Dynamic JS Elements<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often web developers need to check if an element is hidden or visible in jQuery. Here is how to do this.<\/p>\n","protected":false},"author":1,"featured_media":4707,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[295],"tags":[309,310],"class_list":["post-4682","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-hidden","tag-visible"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Check if Element is Hidden in JQuery - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Often web developers need to check if an element is hidden or visible in jQuery. Here is how to determine element visibility in jQuery.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Check if Element is Hidden in JQuery - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Often web developers need to check if an element is hidden or visible in jQuery. Here is how to determine element visibility in jQuery.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-27T07:18:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-27T08:55:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/09\/check-if-element-hidden-jquery.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"320\" \/>\n\t<meta property=\"og:image:height\" content=\"214\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Check if Element is Hidden in JQuery\",\"datePublished\":\"2024-09-27T07:18:25+00:00\",\"dateModified\":\"2024-09-27T08:55:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/\"},\"wordCount\":1224,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/09\/check-if-element-hidden-jquery.jpg?fit=320%2C214&ssl=1\",\"keywords\":[\"hidden\",\"visible\"],\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/\",\"url\":\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/\",\"name\":\"How to Check if Element is Hidden in JQuery - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/09\/check-if-element-hidden-jquery.jpg?fit=320%2C214&ssl=1\",\"datePublished\":\"2024-09-27T07:18:25+00:00\",\"dateModified\":\"2024-09-27T08:55:52+00:00\",\"author\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Often web developers need to check if an element is hidden or visible in jQuery. Here is how to determine element visibility in jQuery.\",\"breadcrumb\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/09\/check-if-element-hidden-jquery.jpg?fit=320%2C214&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/09\/check-if-element-hidden-jquery.jpg?fit=320%2C214&ssl=1\",\"width\":320,\"height\":214,\"caption\":\"check if element is hidden in jquery\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ubiq.co\/tech-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Check if Element is Hidden in JQuery\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#website\",\"url\":\"https:\/\/ubiq.co\/tech-blog\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/\"],\"url\":\"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Check if Element is Hidden in JQuery - Ubiq BI","description":"Often web developers need to check if an element is hidden or visible in jQuery. Here is how to determine element visibility in jQuery.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/","og_locale":"en_US","og_type":"article","og_title":"How to Check if Element is Hidden in JQuery - Ubiq BI","og_description":"Often web developers need to check if an element is hidden or visible in jQuery. Here is how to determine element visibility in jQuery.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2024-09-27T07:18:25+00:00","article_modified_time":"2024-09-27T08:55:52+00:00","og_image":[{"width":320,"height":214,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/09\/check-if-element-hidden-jquery.jpg","type":"image\/jpeg"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Check if Element is Hidden in JQuery","datePublished":"2024-09-27T07:18:25+00:00","dateModified":"2024-09-27T08:55:52+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/"},"wordCount":1224,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/09\/check-if-element-hidden-jquery.jpg?fit=320%2C214&ssl=1","keywords":["hidden","visible"],"articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/","name":"How to Check if Element is Hidden in JQuery - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/09\/check-if-element-hidden-jquery.jpg?fit=320%2C214&ssl=1","datePublished":"2024-09-27T07:18:25+00:00","dateModified":"2024-09-27T08:55:52+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Often web developers need to check if an element is hidden or visible in jQuery. Here is how to determine element visibility in jQuery.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/09\/check-if-element-hidden-jquery.jpg?fit=320%2C214&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/09\/check-if-element-hidden-jquery.jpg?fit=320%2C214&ssl=1","width":320,"height":214,"caption":"check if element is hidden in jquery"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-element-is-hidden-in-jquery\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Check if Element is Hidden in JQuery"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/09\/check-if-element-hidden-jquery.jpg?fit=320%2C214&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-1dw","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/4682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=4682"}],"version-history":[{"count":43,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/4682\/revisions"}],"predecessor-version":[{"id":4728,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/4682\/revisions\/4728"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/4707"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=4682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=4682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=4682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}