📅  最后修改于: 2022-03-11 15:01:58.245000             🧑  作者: Mango
// use attribute .tagName, which returns a type e.g. DIV, BUTTON, LI etc.
const functionName = () => {
if(e.target.tagName == 'BUTTON') {
console.log("It's a button";
} else {
console.log("It's not a button");
}
}
// if you prefer: function functionName (params) {action} instead of "e.target" use this