首页试题详情
难度: 使用次数:138更新时间:2026/03/16
1.
以下哪项代码是正确使用事件对象的示例?
A.element.onclick = function() { console.log(event.target); }
B.element.addEventListener('click', function() { console.log(event.type); })
C.element.onmouseover = function(event) { console.log(event.srcElement); }
D.以上所有选项都正确。
题型:选择题 知识点:第三章 JavaScript基础
【答案】
D
【解析】
所有选项都展示了正确使用事件对象的方式。A使用了onclick事件的默认处理方式,B使用了addEventListener绑定,C使用了onmouseover并传递了event对象。因此D选项正确。

查看答案和解析

支付 ¥0.1 即可查看此题答案和详细解析

低至 ¥0.1 起

类题推荐:

未分类