Snippet javascript Copy to the clipboard with js
function copyLinkPost(e) {
const el = document.createElement('textarea');
let str = e.target.getAttribute('data-link-copy');
console.log(str);
el.value = str;
el.setAttribute('readonly', '');
el.style.position = 'absolute';
el.style.left = '-9999px';
document.body.appendChild(el);
el.select();
el.setSelectionRange(0, 99999)
document.execCommand("copy");
document.body.removeChild(el);
console.log("Copied the text: " + el.value);
}