focus
将 HTMLElement的函数存储在变量中的正确上下文是什么?
我试过了,
var elem = document.getElementById('elem');
var focus = elem.focus.bind(document); // focus() Illegal Invocation
var focus2 = elem.focus.bind(elem); // focus2() Illegal Invocation
focus
将 HTMLElement的函数存储在变量中的正确上下文是什么?
我试过了,
var elem = document.getElementById('elem');
var focus = elem.focus.bind(document); // focus() Illegal Invocation
var focus2 = elem.focus.bind(elem); // focus2() Illegal Invocation