모쿠 2017. 3. 29. 15:36

<여러가지 입력 타입>

- HTML5부터 다양한 입력타입을 사용할 수 있음



<13_input.html>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Input</title>
</head>
<body>
<h1>여러가지 input type</h1>
<!-- form에서 method를 지정하지 않으면 get 방식이 디폴트 -->
<form action="result.html">
    아이디<span style="color: red;">(*)</span><br/>
    <input type="text" name="userid" required="required" /><br/>
    비밀번호:<br/>
    <input type="password" name="passwd" required="required"><br/>
    이메일:<br/>
    <input type="email" name="email" /><br/<!-- HTML5 -->
    나이:<br/>
    <input type="number" name="age"/><br/<!-- HTML5 -->
    전화번호:<br/>
    <input type="tel" name="tel"/><br/<!-- HTML5 -->
    생일:<br/>
    <input type="date" name="date"/><br/<!-- HTML5 -->
    <input type="datetime" name="datetime"/><br/<!-- HTML5 크롬 사용 불가능 -->
    
    <input type="submit" value="회원 가입">
    <input type="reset" value="취소">
    
</form>
</body>
</html>
cs