< Back to Code

Toggle to view more text – Jquery

Hello, this is content1 class
Hello, this is content2 class - slide toggle
The long text the better
Longer
longerr
<div class="content1">Hello, this is content1 class</div>
<div class="content2">Hello, this is content2 class - slide toggle<br> The long text the better<br>Longer<br>longerr</div>
<button id="viewmore">View more...</button>

<script>
$(document).ready(function(){
$("div.content2").hide();


$("button#viewmore").click(function(){
$("div.content2").slideToggle();
});
});
</script>

© Copyright by JAYbranding – All rights reserved.

We would like to advise you in more detail.
Please enter information to receive a consultation