您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

HTML5基础学习 19-表单

2019/5/11 2:00:20发布57次查看
html5 forms
html5 brings many features and improvements to web form creation. there are new attributes and input types that were introduced to help create better experiences for web users.
form creation is done in html5 the same way as it was in html4:
html5为web表单创建带来了许多功能和改进。 引入了新的属性和输入类型,以帮助为网络用户创造更好的体验。
html中的表单创建方式与html4中一样:
1 新属性 new attributeshtml5 has introduced a new attribute called placeholder. on and elements, this attribute provides a hint to the user of what information can be entered into the field.
html5引入了一个名为placeholder的新属性。 在和元素上,此属性向用户提供可以在该字段中输入哪些信息的提示。
the autofocus attribute makes the desired input focus when the form loads:
2 forms with required fieldsthe required attribute is used to make the input elements required.
the form will not be submitted without filling in the required fields.
the autocomplete attribute specifies whether a form or input field should have autocomplete turned on or off.when autocomplete is on, the browser automatically complete values based on values that the user has entered before.
autocomplete属性指定表单或输入字段是否应该启用或禁用自动完成。
当自动填充开启时,浏览器会根据用户之前输入的值自动完成值。
html5添加了几种新的输入类型:- color- date- datetime- datetime-local- email- month- number- range- search- tel- time- url- weeknew input attributes in html5:- autofocus- form- formaction- formenctype- formmethod- formnovalidate- formtarget- height and width- list- min and max- multiple- pattern (regexp)- placeholder- required- step
3 搜索框 creating a search box
search options
the tag can be used to define a list of pre-defined options for the search field:
标签可用于定义搜索字段的预定义选项列表:
defines the options in a drop-down list for the user to select. the id of the datalist element must match with the list attribute of the input box.
在用户选择的下拉列表中定义选项。
datalist元素的id必须与输入框的list属性相匹配。
creating more fieldssome other new input types include email, url, and tel:
these are especially useful when opening a page on a modern mobile device, which recognizes the input types and opens a corresponding keyboard matching the fields type:
当在现代移动设备上打开页面时,这些功能特别有用,它识别输入类型并打开与字段类型匹配的相应键盘:
these new types make it easier to structure and validate html forms.
这些新类型使得html表单更易于构造和验证。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product