"Understanding jQuery and Bootstrap"
Bootstrap 3.3.0 Snippet by dgambs

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <h2>Learning jQuery</h2> <br> <button id="hideText" type="button" class="btn btn-warning">Hide Paragraphs</button><br> <button id="hideLink" type="button" class="btn btn-danger">Hide Image</button> <hr> <img id:="byeLink" src="https://orig00.deviantart.net/3641/f/2012/281/a/e/8_bit_sprites__link_by_toshirofrog-d5h8f42.png" width=25%><br> <p>This is a paragraph with little content.</p> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheet</p> <img src="https://i.imgur.com/ppfkm.png" id="lttpLink"><br> <button id="moveLink" type="button" class="btn btn-success">Who Knows</button> </div> </div>
h2 { color: 'red' }
$(document).ready(function(){ $("#hideText").click(function(){ $("p").toggle(); $("#hideText").text(function(i, text){ return text === "Bring it back" ? "Hide Something" : "Bring it back"; }); }); $("#hideLink").click(function(){ $("#byeLink").fadeToggle("slow"); $("#hideLink").text(function(i, text){ return text === "Bring back Link" ? "Hide Image" : "Bring back Link"; }); }); $("#moveLink").click(function(){ $("#lttpLink").slideUp(2000).slideDown(2000); }); });

Related: See More


Questions / Comments: