copy to clipboard button javascript code example
Example 1: javascript how-do-i-copy-to-the-clipboard-in-javascript
function copyToClipboard(text) {
var input = document.body.appendChild(document.createElement("input"));
input.value = text;
input.focus();
input.select();
document.execCommand('copy');
input.parentNode.removeChild(input);
}
Example 2: jquery copy to clipboard
document.execCommand("copy");