Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #copy #clipboard
ADD COMMENT
Topic
Name
7+8 =