JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<div id="cont">
This is test.This is test.This is test.This is testThis is test.This is testThis is testThis is testThis is testThis is test
</div>
<a id="animate">Godown</a>
CSS
#cont{
height:45px
}
#animate {
text-decoration: none;
-webkit-transition:1s;
}
#animate:hover {
text-decoration: underline;
cursor: pointer;
-webkit-transition:1s;
}
JavaScript
$("#animate").click(function() {
var text = $(this).html();
debugger;
if (text === "Godown") {
$("#cont").animate({
height: "100px"
}, 200, function() {
$("#animate").html('GoTop').hide().show(0);
});
} else {
$("#cont").animate({
height: "45px"
}, 200, function() {
$("#animate").html('Godown').hide().show(0);
});
}
});