JSFiddle - React, Tailwind, and code Playground

HTML

<div class="feedback-box">
    <p class="feedback-text">this is the text that goes in the paragraph even more text goes here lots and lots of text </p>
</div>
<input type="button" id="foo" value="toogle" />

CSS

.feedback-box{
background-color:red;
}

JavaScript

$('#foo').click(function(){
      var h = $('.feedback-text').parent().height();
     $('.feedback-text').toggle()
     $('.feedback-text').parent().height(h);
});