I have a button on my website that when you click expand some text. And I need to make so when you hover mouse over that button, text changes to "Expand" and when text is expanded, and you hover over same button, text needs to be changed to "collapse". Here is my code: HTML:
<button id="btnSlideUp" class="btn btn-outline-success btn-sm title">
<h1 class="jumbotron-heading" id="title">TEXT</h1>
</button>
<p class="lead text-muted" id="p1">TEXT</p>
Css:
#p1{
display:none;
}
jQuery:
var isUp=true;
$('#btnSlideUp').click(function() {
if(isUp){
$('#p1').slideDown(1000);
isUp=false;
}else{
$('#p1').slideUp(1000);
isUp=true;
}
});
Thank you very much for any help given!