Copy to clipboard in jquery

 function copyToClipboard(elementId) {

var copyTextarea = document.getElementById(elementId);
console.log(copyTextarea);
copyTextarea.select();
document.execCommand(“copy”);
jQuery(“.copy”).html(“Copied”);
if (jQuery(‘.tcopy’).length) {
jQuery(‘#’ + elementId.slice(1)).html(“Copied”);
}
jQuery(“#liveToast”).toast(“show”);
}

Leave a Comment

Your email address will not be published. Required fields are marked *