document.querySelectorAll(".auto-adjust-sample-textarea").forEach((targetArea) => { // 初期値によってtextarea高さをadjust let lineHeight = Number(targetArea.rows); while (targetArea.scrollHeight > targetArea.offsetHeight){ lineHeight++; targetArea.rows = lineHeight; } // 入力値によってtextarea高さをadjust this.addEventListener('input', (e) => { e.srcElement.style.height = 0 e.srcElement.style.height = e.srcElement.sc