"Button text change with content show hide"
Bootstrap 4.0.0 Snippet by Biplab01198

<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"> <div class="col-md-12"> <div class="content_wrapper_text"> <button id="myShowHidebtn" class="btn btn-primary">Hide</button> <p style="display: none;">Paragraph Containt..Paragraph Containt..Paragraph Containt..Paragraph Containt..Paragraph Containt..</p> </div> </div> </div> </div>
.page-title{ background: #e7e7e7 none repeat scroll 0 0; border: 1px solid #c1c1c1; font-weight: 100; margin: 0; padding: 15px 0; text-transform: uppercase; } .widget { background: #ececec none repeat scroll 0 0; border: 1px solid #adadad; border-radius: 5px 5px 0 0; margin: 20px 0; padding: 0; } .widget-title { background: #e4e4e4 none repeat scroll 0 0; border-radius: 5px 5px 0 0; font-size: 22px; font-weight: 100; margin: 0; padding: 15px 0; text-transform: uppercase; } .add-remove-class{ margin:15px 0px; } .show-more-snippet { height:35px; width:100%; overflow:hidden; } #div-id{ display:none; } .content_wrapper_text{ margin: 30px 0; background: #dfdfdf; padding: 30px; } .content_wrapper_text p{ margin: 15px 0 0 0 ; }
/*! * Validator v0.10.2 for Bootstrap 3, by @1000hz * Copyright 2016 Biplab *biplab.cs.nu.bd017@gmail.com * */ $(document).ready(function () { $("button").click(function () { $("p").stop(true).toggle("slow"); $("#myShowHidebtn").text(function (i, t) { return t == 'Hide' ? 'Show' : 'Hide'; }); }); });

Related: See More


Questions / Comments: