更新时间:2023-10-28 20:08:46
你需要 apply
上下文中的事件处理程序那个元素:
You need to apply
the event handler in the context of that element:
var elem = document.getElementById("linkid");
if (typeof elem.onclick == "function") {
elem.onclick.apply(elem);
}
否则此
会引用上面代码执行的上下文。
Otherwise this
would reference the context the above code is executed in.