:hidden Selector - Javascript jQuery Selector

Javascript examples for jQuery Selector:hidden

Description

The :hidden selector selects hidden elements.

Hidden elements includes:

  • element set to display:none
  • form elements with type="hidden"
  • width and height set to 0

This selector does not work on elements with visibility:hidden.

The following code shows how to Show hidden <p> elements:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("p:hidden").show(3500);
});/* w w w  .j  a  va2s  .c  o m*/
</script>
</head>
<body>
<p style="display:none;">This is a hidden paragraph that is slowly shown.</p>

<p>This is a paragraph.</p>
<p style="display:none;">This is a hidden paragraph that is slowly shown.</p>

<p>This is another paragraph.</p>
<p style="display:none;">This is a hidden paragraph that is slowly shown.</p>

</body>
</html>

Related Tutorials