📅  最后修改于: 2022-03-11 15:02:14.630000             🧑  作者: Mango
const target = document.getElementById("target");
target.addEventListener('click', () => target.style.opacity = '0');
// If you want to remove it from the page after the fadeout
target.addEventListener('transitionend', () => target.remove());