function copy(button){ button.previousElementSibling.select(); document.execCommand("Copy"); button.classList.add("copied"); button.animate( { opacity: [1 ,0] }, { fill: "forwards", pseudoElement: "::after", duration: 2000 } ).onfinish=()=>{ button.classList.remove("copied"); }; } See the Pen 署名 on …