- ·上一篇文章:HTML button type 属性
- ·下一篇文章:HTML button value 属性
HTML button autofocus 属性
由 ega520 创建,Carrie 最后一次修改 2016-08-23 HTML <button> autofocus 属性 HTML <button> 标签设置了 autofocus 属性的按钮,将在页面加载后自动获取焦点,请参考下述示例:实例按钮使用 autofocus 属性:<button type="button" autofocus>点我!</button>尝试一下 ?浏览器支持Internet Explorer 10, Firefox, Chrome, 和 Safari 支持autofocus 属性。注意: Internet Explorer 9 以及更早IE版本不支持 autofocus 属性。定义和用法autofocus 属性是一个 boolean(布尔) 属性。autofocus 属性规定当页面加载时按钮应当自动地获得焦点。提示:HTML 4.01 与 HTML5之间的差异autofocus 属性是 HTML5 <button> 标签的新属性。HTML 与 XHTML之间的差异在 XHTML 中, 不允许属性简写,autofocus 属性必须定义为 <button autofocus="autofocus">。 语法<button type="button" autofocus> HTML <button> 标签
HTML button autofocus 属性