"Learning jQuery"
Bootstrap 4.0.0 Snippet by AmyMorand

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <h2>Learning jQuery</h2> <h1>This is a heading</h1> <h3>This is also heading</h3> <p>This is a paragraph.</p><br> <p>This is another paragraph.</p><br> <button type="button" class="btn btn-success 1">Click me to hide paragraphs</button> <button type="button" class="btn btn-success 2">Click me to hide little headings</button> <button type="button" class="btn btn-success 3">Click me to hide big headings</button> </div> </div>
$(document).ready(function(){ $(".btn btn-success 1").click(function(){ $("p").toggle(); }); $(".btn btn-success 2").click(function(){ $("h3").toggle(); }); $(".btn btn-success 3").click(function(){ $("h1").toggle(); }); });

Related: See More


Questions / Comments: