자동으로 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에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5852 | 9년 전 | 615 | ||
| 5851 | 9년 전 | 544 | ||
| 5850 | 9년 전 | 398 | ||
| 5849 | 9년 전 | 304 | ||
| 5848 | 9년 전 | 303 | ||
| 5847 | 9년 전 | 298 | ||
| 5846 | 9년 전 | 280 | ||
| 5845 | 9년 전 | 304 | ||
| 5844 | 9년 전 | 324 | ||
| 5843 | 9년 전 | 418 | ||
| 5842 | 9년 전 | 309 | ||
| 5841 | 9년 전 | 1078 | ||
| 5840 |
|
9년 전 | 1206 | |
| 5839 | 9년 전 | 590 | ||
| 5838 | 9년 전 | 321 | ||
| 5837 | 9년 전 | 368 | ||
| 5836 | 9년 전 | 366 | ||
| 5835 | 9년 전 | 494 | ||
| 5834 | 9년 전 | 338 | ||
| 5833 | 9년 전 | 453 | ||
| 5832 | 9년 전 | 286 | ||
| 5831 | 9년 전 | 271 | ||
| 5830 | 9년 전 | 285 | ||
| 5829 | 9년 전 | 334 | ||
| 5828 | 9년 전 | 312 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기