Answers for "jtextarea auto resize"

CSS
7

textarea resize off

<textarea class="myTextArea"></textarea>
<style>
  .myTextArea {
    resize: none;
  }
</style>
Posted by: Guest on April-24-2020
0

javascript textarea autosize

function addAutoResize() {
  document.querySelectorAll('[data-autoresize]').forEach(function (element) {
    element.style.boxSizing = 'border-box';
    var offset = element.offsetHeight - element.clientHeight;
    element.addEventListener('input', function (event) {
      event.target.style.height = 'auto';
      event.target.style.height = event.target.scrollHeight + offset + 'px';
    });
    element.removeAttribute('data-autoresize');
  });
}
Posted by: Guest on April-13-2022

Browse Popular Code Answers by Language