SAE15_2022/assets/js/contact.js

8 lines
280 B
JavaScript

textarea = document.getElementById('message');
textarea.setAttribute('style', 'height:' + (textarea.scrollHeight) + 'px;overflow-y:hidden;');
textarea.addEventListener("input", function () {
this.style.height = 'auto';
this.style.height = (this.scrollHeight) + 'px';
});