copy to clipboard javascript iphone code example
Example 1: js copy to clipboard
navigator.clipboard.writeText("Hello, World!");
Example 2: js copy to clipboard
function textToClipboard (text) {
var dummy = document.createElement("textarea");
document.body.appendChild(dummy);
dummy.value = text;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
}