当我运行此代码时,为什么 .body 事件首先触发?
document.addEventListener('click', function() {
console.log('The document was clicked');
});
document.body.addEventListener('click', function() {
console.log('The document body was clicked');
});Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1184 次 |
| 最近记录: |