HTML5學習記錄(二)

HTML5 Input 類型

輸入類型

HTML5 擁有多個新的表單輸入類型。這些新特性提供了更好的輸入控制和驗證。

  • email
  • 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>

演示結果:
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章