# HTML input URL: https://chengjinfang.com/posts/2017/web-html2/ Author: 程锦方 Date: 2017-09-17 Tags: #note #html #web Summary: 参考于: http://www.w3school.com.cn/tags/tag_input.asp http://www.w3school.com.cn/tags/att_input_type.asp http://www.w3school.com.cn/html5/html_5_form_input_types.a ------------------------------------------------------------------------ 参考于: http://www.w3school.com.cn/tags/tag_input.asp http://www.w3school.com.cn/tags/att_input_type.asp http://www.w3school.com.cn/html5/html_5_form_input_types.asp ## input元素 ![](https://chengjinfang.com/posts/2017/images/web/2.png) ### url url类型的input元素是专门用来输入url地址格式的文本框,如果不是url类型的的内容不允许提交. ```html ``` ### email email类型的input元素是专门用来输入email地址格式的文本框,如果不是email类型的的内容不允许提交. 提交时该文本框可以为空除非加上required属性. ```html ``` ### date ```html ``` ### time time类型的input元素是一种专门用来输入时间的文本框,并且在提交时间时对输入的时间时效性进行检查. ```html ``` ### datetime datetime类型的input元素是一种专门用来输入utc日期和时间的文本框,并且在提交时间时对输入的时间时效性进行检查. ```html ``` ### datetime-local datetime-local类型的input元素是一种专门用来输入本地日期和时间的文本框,并且在提交时进行检查. ```html ``` ### month month是一种专门用来输入月份的文本框. ```html ``` ### week week类型专门用来输入周号. ```html ``` ### input输入值的限定 ![](https://chengjinfang.com/posts/2017/images/web/1.png) ------------------------------------------------------------------------ Site: https://chengjinfang.com/ · All Index: https://chengjinfang.com/all/ · RSS: https://chengjinfang.com/rss.xml