📅  最后修改于: 2022-03-11 15:01:37.501000             🧑  作者: Mango
//event.target would help you in this
if (event.target.className === "delete") {
console.log("HELLO")
this.shortcutArray.splice(index, 1);
}
form.onclick = function(event) {
event.target.style.backgroundColor = 'yellow';
// chrome needs some time to paint yellow
setTimeout(() => {
alert("target = " + event.target.tagName + ", this=" + this.tagName);
event.target.style.backgroundColor = ''
}, 0);
};