Select and hide all elements with class="test". - Javascript jQuery

Javascript examples for jQuery:Hide

Description

Select and hide all elements with class="test".

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(){
    $(".test").hide();
});/*from  w ww  . j  a va  2  s.  c o m*/
</script>
</head>
<body>

<h2 class="test">This is a heading</h2>

<p class="test">This is a paragraph.</p>
<p>This is another paragraph.</p>

</body>
</html>

Related Tutorials