Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

auto increase textarea height

//html
<textarea name="text" oninput="auto_grow(this)"></textarea>

//js
<script>
function auto_grow(element) {
    element.style.height = "auto";
    element.style.height = (element.scrollHeight)+"px";
  };
 const x = document.querySelector('#textarea-input')
 x.onsubmit = (event) => {
    messageBox.style.height = 'auto';}
</script>
 
PREVIOUS NEXT
Tagged: #auto #increase #textarea #height
ADD COMMENT
Topic
Name
9+8 =