2024年1月31日发(作者:)
html的button属性设置
html中的button标签是常用的标签之一,它的具体属性包括很多方面,下面由店铺为大家整理了html的button属性设置,希望对大家有帮助!
html的button属性设置
定义和用法
在 button 元素内部,您可以放置内容,比如文本或图像。这是该元素与使用 input 元素创建的按钮之间的不同之处。
唯一禁止使用的元素是图像映射,因为它对鼠标和键盘敏感的动作会干扰表单按钮的行为。
请始终为按钮规定 type 属性。Internet Explorer 的默认类型是
"button",而其他浏览器中(包括 W3C 规范)的默认值是 "submit"。
HTML 4.01 与 HTML 5 之间的差异
HTML 5 中的新属性:autofocus, form, formaction,
formenctype, formmethod, formnovalidate 以及 formtarget。
提示和注释
注释:如果在 HTML 表单中使用 button 元素,不同的浏览器会提交不同的按钮值。请使用 input 元素在 HTML 表单中创建按钮。
button属性设置
new : HTML5 中的新属性。
autofocus
autofocus
规定当页面加载时按钮应当自动地获得焦点。
disabled
form
formaction
disabled 规定应该禁用该按钮。
规定按钮属于一个或多个表单。
覆盖 form 元素的 action 属性。
注释:该属性与 type="submit" 配合使用。
覆盖 form 元素的 enctype 属性。
注释:该属性与 type="submit" 配合使用。
覆盖 form 元素的 method 属性。
注释:该属性与 type="submit" 配合使用。
form_name
url
formenctype 见注释
formmethod get
post
formnovalidate formnovalidate
覆盖 form 元素的 novalidate 属性。
注释:该属性与 type="submit" 配合使用。
formtarget _blank
_self
_parent
_top
覆盖 form 元素的 target 属性。
注释:该属性与 type="submit" 配合使用。
framename
button_name 规定按钮的名称。
规定按钮的类型。
name
type
button
reset
submit
value
text 规定按钮的初始值。可由脚本进行修改。
注释:formenctype 属性可能的值:
application/x-www-form-urlencoded
multipart/form-data
text/plain
本文发布于:2024-01-31 06:51:50,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170665511026403.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |