Javascript examples for jQuery:Selector
$("p.intro") Selects all <p> elements with class="intro"
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("p.intro").hide(); });//from www . j av a2 s. c o m }); </script> </head> <body> <h2 class="intro">This is a heading</h2> <p class="intro">This is a paragraph.</p> <p>This is another paragraph.</p> <button>Click me</button> </body> </html>