Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript copy div element content

function CopyToClipboard(containerid) {
    var range = document.createRange();
    range.selectNode(document.getElementById(containerid));
    window.getSelection().removeAllRanges(range);
  	window.getSelection().addRange(range);
    document.execCommand("copy");
    alert("Text Copied to clipboard");
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #copy #div #element #content
ADD COMMENT
Topic
Name
6+5 =