핵심 코드: 코드 복사 코드는 다음과 같습니다. <br>function adjustObjHeight(obj, defaultHeight) { <br>if(obj.scrollHeight > defaultHeight) { <br>obj.style.height = obj.scrollHeight 'px' ; <br>} else { <br>obj.style.height = defaultHeight 'px'; <br>} <br>} <br>window.onload = function() { <br>var obj = document.getElementsByTagName( 'textarea' ); <br>var len = obj.length; <br>for(var i = 0; i<len; i ) <BR>adjustObjHeight(obj[i], 50) <BR>< /script> <br><br> </div>TextArea HTML 코드: <br><br><div class="codetitle"><span><a style="CURSOR: pointer" data="75226" class="copybut" id="copybut75226" onclick="doCopy('code75226')">코드 복사<u></u></a> : </span></div> <div class="codebody" id="code75226"><textarea id="content" onkeyup="adjustObjHeight(this, 50);"></textarea> <br><br> </div>저자 He Chaoyang