codecamp

window属性:onfocus

onfocus属性

该onfocus属性返回当前元素的onFocus事件处理程序代码。

onfocus属性语法

element.onfocus = event handling code

笔记

当用户将焦点放在给定元素上时将引发focus事件。

为了在非输入元素上触发onfocus,它们必须被赋予tabindex属性。

与MSIE相反,几乎所有类型的元素都会收到focus事件,但Gecko浏览器上几乎所有类型的元素都不适用于此事件。

规范

规范状态注释
HTML Living Standard
规范中的'onfocus'的定义。
Living Standard
 

浏览器兼容性

我们正在将兼容性数据转换为机器可读的JSON格式。

  • 电脑端
特征Chrome
Firefox(Gecko)Internet Explorer
Opera
Safari(WebKit)
基本支持支持
  • 移动端

特征AndroidAndroid WebviewChrome for AndroidFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari Mobile
基本支持????????
window属性:onerror
window属性:ongamepadconnected
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

Fetch API官方文档指南

Fetch API方法

WindowOrWorkerGlobalScope执行者:window

window属性

WindowOrWorkerGlobalScope执行者:WorkerGlobalScope

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }