意见箱
恒创运营部门将仔细参阅您的意见和建议,必要时将通过预留邮箱与您保持联络。感谢您的支持!
意见/建议
提交建议

html5input有新属性吗

来源:恒创科技 编辑:恒创科技编辑部
2024-01-13 22:32:59

html5 input有新增属性,分别为:autocomplete、autofocus、form、height、list、max、min、multiple、pattern、placeholder、required、step、width等等。

本教程操作环境:windows7系统、HTML5版、Dell G3电脑。

<input> 标签规定了用户可以在其中输入数据的输入字段。

<input> 元素在 <form> 元素中使用,用来声明允许用户输入数据的 input 控件。

输入字段可通过多种方式改变,取决于 type 属性。

HTML5 input标签新增属性

属性值描述autocompleteon offautocomplete 属性规定 <input> 元素输入字段是否应该启用自动完成功能。autofocusautofocus属性规定当页面加载时 <input> 元素应该自动获得焦点。formform_idform 属性规定 <input> 元素所属的一个或多个表单。formactionURL属性规定当表单提交时处理输入控件的文件的 URL。(只针对 type="submit" 和 type="image")formenctypeapplication/x-www-form-urlencoded multipart/form-data text/plain属性规定当表单数据提交到服务器时如何编码(只适合 type="submit" 和 type="image")。formmethodget post定义发送表单数据到 action URL 的 HTTP 方法。 (只适合 type="submit" 和 type="image")formnovalidateformnovalidateformnovalidate 属性覆盖 <form> 元素的 novalidate 属性。formtarget_blank _self _parent _topframename规定表示提交表单后在哪里显示接收到响应的名称或关键词。(只适合 type="submit" 和 type="image")heightpixels规定 <input>元素的高度。(只针对type="image")listdatalist_id属性引用 <datalist> 元素,其中包含 <input> 元素的预定义选项。maxnumber date属性规定 <input> 元素的最大值。minnumber date属性规定 <input>元素的最小值。multiplemultiple属性规定允许用户输入到 <input> 元素的多个值。patternregexppattern 属性规定用于验证 <input> 元素的值的正则表达式。placeholdertextplaceholder 属性规定可描述输入 <input> 字段预期值的简短的提示信息 。requiredrequired属性规定必需在提交表单之前填写输入字段。stepnumberstep 属性规定 <input> 元素的合法数字间隔。widthpixelswidth 属性规定 <input> 元素的宽度。 (只针对type="image")

推荐教程:《html视频教程》

以上就是html5 input有新属性吗的详细内容,更多请关注恒创科技其它相关文章!

上一篇: 绚丽的极光用CSS也能实现! 下一篇: 手机怎么远程登录云服务器?