Home  >  Article  >  Web Front-end  >  jQuery determines whether an element is hidden code_jquery

jQuery determines whether an element is hidden code_jquery

WBOY
WBOYOriginal
2016-05-16 18:07:29908browse

Core code:

Copy code The code is as follows:

if($("#elem_id") .is(":hidden"))
{
}

Example code 1:
Copy code The code is as follows:




New Document



















jquery determines whether the div hides the instance
Copy code The code is as follows:





Binding function

<script> <br>$(document).ready(function(){ <br>var temp= $("#test").is( ":hidden");//Whether it is hidden<br>var temp1= $("#test").is(":visible");//Whether it is visible<br>alert(temp); <br>alert(temp1 ) ; <br>}); </script>


Refresh test





Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn