테스트 사이트 - 개발 중인 베타 버전입니다

자동으로 textarea 크기 조절하기

· 12년 전 · 5232 · 2
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>

<body>
<textarea name="textarea" scol cols="50" rows="5" onKeyDown="setLine( this )"></textarea>

<script language="javascript">
       function setLine( txa ){
              line = 5 //기본 줄 수
       
              new_line = txa.value.split( "\n" ).length + 1;
              if( new_line < line ) new_line = line;

              txa.rows = new_line;
       }

</script>
</body>
</html>

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 2개

감사요~
감사요~

게시글 목록

번호 제목
11040
11037
11028
11019
11017
11012
10999
10990
10984
20478
20151
10973
10970
10966
10962
10961
10959
10958
10951
10947
10945
10944
20463
10943
10939