let function run(){
console.log(event.target)
};
document.getElementById('id').onclick=run;
点击元素或者document.getElementById('id').click()自然可以拿到target,
我想通知直接执行run()方法怎么改变target为指定元素,
run.call(document.getElementById('id'))也是不行,不知道参数不对还是不能这样用,求解:### 问题描述
问题出现的环境背景及自己尝试过哪些方法
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
如果你只是使用
target
一个参数的话:也可以用
this