TIL wecode 12. textarea vs input

이조은·2020년 7월 29일
0

TIL wecode

목록 보기
11/36

1. input type text

  • The <input> tag specifies an input field where the user can enter data.
    <input> elements are used within a <form> element to declare input controls that allow users to input data.
    An input field can vary in many ways, depending on the type attribute.
  • 인풋 태그는 사용자가 데이터를 입력할 수 있는 공간을 지칭한다. 사용자가 데이터를 입력할 수 있도록 하는 인풋 컨트롤을 선언하기 위해 보통 폼 요소 안에서 인풋은 사용된다. 그리고 인풋 필드는 많은 타입 속성을 가지고 있는데 text, password, submit, reset 등이 있다.
<input name="txtDescEd" type="text">

what are the different types of input types?

2. Textarea

  • The <textarea> tag defines a multi-line text input control.
    A text area can hold an unlimited number of characters, and the text renders in a fixed-width font (usually Courier).
    The size of a text area can be specified by the cols and rows attributes, or even better; through CSS' height and width properties.
  • 텍스트에리어는 많은 줄의 텍스트를 입력할 수 있다는 특징이 있다. 텍스트에리어의 사이즈는 cols와 rows로 한정할 수 있고, CSS에서 높이와 너비 프로퍼티를 쓰는 것도 하나의 방법이다.
<textarea name="txtDescEd" cols="60" rows="10"></textarea>

Input vs Textarea

input은 한 줄만을 허용하기 때문에 성, 이름, 전화번호 등의 값을 받을 때 유용하고, textarea는 많은 줄을 쓸 수 있기 때문에 주소, 의견 등의 값을 받을 때 쓰면 좋을 것 같다.

profile
싱글벙글

0개의 댓글