HTML5的表單所有type類型

來源:互聯網
上載者:User

標籤:.text   cti   網址   for   選擇   時間   添加   can   生日   

1.button:定義可點擊的按鈕(通常與 JavaScript 一起使用來啟動指令碼)。<br />
<input id="" type="button" name="" value="按鈕" /><br />
<br />


2.checkbox:定義複選框。<br />
<input id="" type="checkbox" name="" />男<br />
<input id="" type="checkbox" name="" checked="checked" />女<br />
<br />

3.cancel:取消按鈕,用於取消submit的提交。<br />
<input id="" type="cancel" name="" /><br />
<br />

4.color:定義拾色器。<br />
<input id="" type="color" name="" /><br />
<br />


5.date:定義 date 控制項(包括年、月、日,不包括時間)。<br />
<input id="" type="date" name="" /><br />
<br />


6.datetime:定義 date 和 time 控制項(包括年、月、日、時、分、秒、幾分之一秒,基於 UTC 時區)。</p>
<form action="">生日 (日期和時間):<input id="" type="datetime" name="" /> <input id="" type="submit" name="" value="提交" /></form>
<p><br />
<br />


7.datetime-local:定義 date 和 time 控制項(包括年、月、日、時、分、秒、幾分之一秒,不帶時區)。<br />
<input id="" type="datetime-local" name="" /><br />
<br />


8.month:定義 month 和 year 控制項(不帶時區)。<br />
<input id="" type="month" name="" /><br />
<br />


9.week:定義 week 和 year 控制項(不帶時區)。<br />
<input id="" type="week" name="" /><br />
<br />

10.time:定義用於輸入時間的控制項(不帶時區)。<br />
<input id="" type="time" name="" /><br />
<br />

11.email:定義用於 e-mail 地址的欄位。</p>
<form action=""></form>
<p>E-mail:<input id="" type="email" name="" /><br />
<br />


12.file:定義檔案選擇欄位和 "瀏覽..." 按鈕,供檔案上傳。<br />
<input id="" type="file" name="" /><br />
<br />


13.hidden:定義隱藏輸入欄位。<br />
<input id="" type="hidden" name="" /><br />
<br />


14.image:定義映像作為提交按鈕。<br />
<input id="" type="image" name="" /><br />
<br />


15.number:定義用於輸入數位欄位。<br />
<input id="" type="number" name="" /><br />
<br />


16.password:定義密碼欄位(欄位中的字元會被遮蔽)。<br />
<input id="" type="password" name="" /><br />
<br />

17.radio:定義選項按鈕。<br />
<input id="" type="radio" name="" />男<br />
<input id="" type="radio" name="" checked="checked" />女<br />
<br />


18.range:定義用於精確值不重要的輸入數位控制項(比如 slider 控制項)。<br />
<input id="" type="range" name="" /><br />
<br />


19.reset:定義重設按鈕(重設所有的表單值為預設值)。<br />
<input id="" type="reset" name="" /><br />
<br />


20.search:定義用於輸入搜尋字串的文字欄位。<br />
<input id="" type="search" name="" /><br />
<br />


21.submit:定義提交按鈕。<br />
<input id="" type="submit" name="" value="提交" /><br />
<br />


22.tel:定義用於輸入電話號碼的欄位。<br />
輸入電話:<input id="" type="tel" name="" /><br />
<br />


23.text:預設。定義一個單行的文字欄位(預設寬度為 20 個字元)。<br />
<input id="" type="text" name="" /><br />
<br />


24.url:定義用於輸入 URL 的欄位。<br />
添加你的首頁網址:<input id="" type="url" name="" /></p

HTML5的表單所有type類型

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.