s

자동으로 textarea 크기 조절하기

· 2013-02-24 (일) 23:36:16 · 8130 · 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개

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

프로그램

8,188건
+
제목 글쓴이 날짜 조회
14-10-13 조회 6,384
14-10-11 조회 6,581
14-10-11 조회 6,500
14-10-11 조회 6,377
14-10-10 조회 6,341
14-10-10 조회 6,187
14-10-08 조회 6,874
14-10-07 조회 6,288
14-10-06 조회 6,652
14-10-06 조회 7,433