1document.addEventListener('click', (e) => { 2 if (e.target.closest('.post .postSharing a')) { 3 e.preventDefault(); 4 const link = e.target.closest('.post .postSharing a'); 5 const url = link.getAttribute('data-share'); 6 navigator.clipboard.writeText(url); 7 } 8});