< 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>
en_US

© Copyright by JAYbranding – All rights reserved.

Chúng tôi mong muốn tư vấn chi tiết hơn cho quý khách.
Vui lòng nhập thông tin để nhận tự vấn