핵심 코드: 코드 복사 코드는 다음과 같습니다. <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> TextArea HTML 코드: 코드 복사 : 저자 He Chaoyang