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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<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>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.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;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*!
* 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';
});
});
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: