📌  相关文章
📜  通过单击获取元素 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:27.799000             🧑  作者: Mango

代码示例3
window.onclick = e => {
    console.log(e.target);  // to get the element
    console.log(e.target.tagName);  // to get the element tag name alone
}