HTML <텍스트 영역> 태그
예시
여러 줄 텍스트 입력 컨트롤(텍스트 영역):
<label for="w3review">Review of W3Schools:</label>
<textarea
id="w3review" name="w3review" rows="4" cols="50">
At w3schools.com you will learn how to make a website. They offer free tutorials in all web development technologies.
</textarea>
아래에서 더 많은 "직접 사용해 보기" 예를 살펴보세요.
정의 및 사용
<textarea>
태그는 여러 줄 텍스트 입력 컨트롤을 정의합니다 .
요소 는 <textarea>
댓글이나 리뷰와 같은 사용자 입력을 수집하기 위해 양식에서 자주 사용됩니다.
텍스트 영역에는 무제한의 문자가 포함될 수 있으며 텍스트는 고정 너비 글꼴(보통 Courier)로 렌더링됩니다.
텍스트 영역의 크기는 <cols>
및 <rows>
속성(또는 CSS 사용)으로 지정됩니다.
name
속성은 양식이 제출된 후 양식 데이터를 참조하는 데 필요합니다(속성을 생략하면 텍스트
name
영역의 데이터가 제출되지 않음).
id
속성은 텍스트 영역을 레이블과 연결하는 데 필요합니다 .
팁: 최상의 접근성을 위해 항상 <label> 태그를 추가하십시오!
브라우저 지원
Element | |||||
---|---|---|---|---|---|
<textarea> | Yes | Yes | Yes | Yes | Yes |
속성
Attribute | Value | Description |
---|---|---|
autofocus | autofocus | Specifies that a text area should automatically get focus when the page loads |
cols | number | Specifies the visible width of a text area |
dirname | textareaname.dir | Specifies that the text direction of the textarea will be submitted |
disabled | disabled | Specifies that a text area should be disabled |
form | form_id | Specifies which form the text area belongs to |
maxlength | number | Specifies the maximum number of characters allowed in the text area |
name | text | Specifies a name for a text area |
placeholder | text | Specifies a short hint that describes the expected value of a text area |
readonly | readonly | Specifies that a text area should be read-only |
required | required | Specifies that a text area is required/must be filled out |
rows | number | Specifies the visible number of lines in a text area |
wrap | hard soft |
Specifies how the text in a text area is to be wrapped when submitted in a form |
전역 속성
<textarea>
태그는 HTML의 전역 속성도 지원 합니다 .
이벤트 속성
<textarea>
태그는 HTML의 이벤트 속성 도 지원합니다 .
더 많은 예
예시
기본 크기 조정 옵션 비활성화:
<html>
<head>
<style>
textarea {
resize: none;
}
</style>
</head>
<body>
<label for="w3review">Review of W3Schools:</label>
<textarea id="w3review" name="w3review" rows="4" cols="50">
At
w3schools.com you will learn how to make a website. They offer free tutorials
in all web development technologies.
</textarea>
</body>
</html>
관련 페이지
HTML DOM 참조: Textarea 객체
CSS 튜토리얼: 양식 스타일 지정
기본 CSS 설정
없음.