jQuery toggleClass example

Toggle class name on click in jQuery

by rince1984

HTML

<div id="app">
  <textarea  oninput="this.style.height=''; 
      this.style.height = Math.min(this.scrollHeight -3 ,67)+'px'" class="demo">
  </textarea>
  <br>
  <input type="button" value="SEND">
</div>

CSS

.demo{
  resize:none;
  max-height:120px;
}

JavaScript

jQuery('#app input').on("click", function(){
  jQuery('#app textarea').html('').css('height',''); //remove content and height
  //jQuery('#app textarea').css('height',''); //remove height
});