MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / copyToClipboard

Function copyToClipboard

assets/js/text-style.js:1–10  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

1function copyToClipboard(value) {
2 const tempInput = document.createElement("textarea");
3 tempInput.style = "position: absolute; left: -1000px; top: -1000px";
4 tempInput.value = value
5 document.body.appendChild(tempInput);
6 tempInput.select();
7 document.execCommand('copy');
8 document.body.removeChild(tempInput);
9 return true;
10}
11
12const ul = document.querySelector('ul')
13const shadows = [

Callers 1

addShadowFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected