举报投诉联系我们 手机版 热门标签 编程学
您的位置:编程学 > html onfocus属性 HTML DOM Input Week autofocus 属性

html onfocus属性 HTML DOM Input Week autofocus 属性

2023-04-27 14:18

html onfocus属性 HTML DOM Input Week autofocus 属性

html onfocus属性 HTML DOM Input Week autofocus 属性

html onfocus属性

Input Week autofocus 属性

Input Week 对象参考手册 Input Week 对象

实例

查看 week 字段是否在页面加载后自动获取焦点:

var x = document.getElementById("myWeek").autofocus;
x输出结果为:
true


定义和用法

autofocus 属性用于设置或者返回 week 字段在页面加载后是否自动获取焦点。

该属性反映了 HTML autofocus 属性。


浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主流浏览器都支持 autofocus 属性

注意: Internet Explorer 9 及更早 IE 版本或者 Opera 12 或更早 Opera 版本浏览器不支持 autofocus 属性。

注意: Internet Explorer 或 Firefox 浏览器不支持 <input type="week"> 元素。


语法

返回 autofocus 属性:

weekObject.autofocus

设置 autofocus 属性:

weekObject.autofocus=true|false

属性值

描述
true|false 描述了 week 字段在页面加载后是否获取焦点
  • true - week 字段获取焦点
  • false - 默认。week 字段不获取焦点

技术细节

返回值: 布尔值,如果页面在加载后 week 字段自动获取焦点返回 true,否则返回false。


相关页面

HTML 参考手册: HTML <input> autofocus 属性


Input Week 对象参考手册 Input Week 对象
阅读全文
以上是编程学为你收集整理的html onfocus属性 HTML DOM Input Week autofocus 属性全部内容。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。
相关文章
© 2024 编程学 bianchengxue.com 版权所有 联系我们
桂ICP备19012293号-7 返回底部