웹개발/html

[html] input 태그 속성과 속성 값 정리

webvillain 2021. 5. 25. 13:44

<input type = "속성" name="이름" value = "속성입니다." >

1. text, password
2. checkbox
3. radio
4. file
5. image
6. button, submit, reset
7. hidden


1. text, password

- input type="text" , input type="password" 

아이디 : <input type="text" name="user_id" size="20">
비밀번호 : <input type="password" name="pwd" size="20">

 

2. checkbox

- input type="checkbox" 

<input type="checkbox" name="fruit" value="Mango" checked>Mango
<input type="checkbox" name="fruit" value="Apple">Apple
<input type="checkbox" name="fruit" value="Strawberry">Strawberry
<input type="checkbox" name="fruit" value="Kiwi">Kiwi

 

3. radio

- input type="radio" 

<input type="radio" name="food" value="양식" checked>양식
<input type="radio" name="food" value="중식">중식
<input type="radio" name="food" value="한식">한식
<input type="radio" name="food" value="일식">일식

 

4. file

- input type="file"

<input type="file" name="fileName" accept="" mutiple>

 

5. image

- input type="image" 

 <input type="image" src="https://pbs.twimg.com/profile_images/883859744498176000/pjEHfbdn_400x400.jpg" width="100">	

 

6. button, submit, reset

- input type="button",   input type="submit",   input type="reset"

<input type="button" value="버튼">

<input type="submit" value="제출 하기">

<input type="reset" value="다시 입력">

 

7. hidden

- input type = "hidden"

<input type="hidden" name="hidden_code" id="hidden_code">

사용자에게 보이지는 않지만 서버로 전송됩니다.