자동으로 textarea 크기 조절하기
<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>
<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개
쉽다zzz
12년 전
감사요~
쉽다zzz
12년 전
감사요~
게시판 목록
팁게시판
디자인과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5152 |
senseme
|
12년 전 | 4168 | |
| 5151 |
senseme
|
12년 전 | 3740 | |
| 5150 |
프로프리랜서
|
12년 전 | 3136 | |
| 5149 |
프로프리랜서
|
12년 전 | 3971 | |
| 5148 |
프로프리랜서
|
12년 전 | 4354 | |
| 5147 |
프로프리랜서
|
12년 전 | 1586 | |
| 5146 |
senseme
|
12년 전 | 2716 | |
| 5145 |
senseme
|
12년 전 | 2715 | |
| 5144 |
senseme
|
12년 전 | 1259 | |
| 5143 | 12년 전 | 1294 | ||
| 5142 | 12년 전 | 8419 | ||
| 5141 |
senseme
|
12년 전 | 1514 | |
| 5140 |
senseme
|
12년 전 | 3748 | |
| 5139 |
senseme
|
12년 전 | 6332 | |
| 5138 |
senseme
|
12년 전 | 1554 | |
| 5137 | 12년 전 | 1151 | ||
| 5136 |
senseme
|
12년 전 | 1326 | |
| 5135 |
senseme
|
12년 전 | 3307 | |
| 5134 |
senseme
|
12년 전 | 1080 | |
| 5133 |
senseme
|
12년 전 | 1824 | |
| 5132 |
senseme
|
12년 전 | 1258 | |
| 5131 |
senseme
|
12년 전 | 910 | |
| 5130 | 12년 전 | 1402 | ||
| 5129 | 12년 전 | 2118 | ||
| 5128 |
senseme
|
12년 전 | 1391 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기