HTML5 Input 類型
輸入類型
HTML5 擁有多個新的表單輸入類型。這些新特性提供了更好的輸入控制和驗證。
- url
- number
- range
- Date pickers (date, month, week, time, datetime, datetime-local)
- search
- color
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5--表單測試</title>
<style>
input{
margin-bottom:20px;}
</style>
</head>
<body>
<form action="" method="get">
E-mail: <input type="email" name="user_email" /><br />
Url: <input type="url" name="user_url" /><br />
Number: <input type="number" name="points" min="1" max="10" /><br/>
Range: <input type="range" name="points" min="1" max="10" /><br/>
Date: <input type="date" name="user_date" /><br/>
Search: <input type="search" name="user_search"/><br/>
Color: <input type="color" name="user_color"/><br/>
<input type="submit"/>
</form>
</body>
</html>
演示結果: