0

I made a button:

var btn = document.createElement("button");
var value = "text I want to copy";
btn.appendChild(document.createTextNode("copy"));
btn.onclick = function(){
// this is something I want, demo code:
copy(value);
console.log("copy successful");
};
// and then when I ctrl + V (paste) to somewhere else, the output should be this:
"text I want to copy"

I hope you get the idea, I hope someone can help me this.

Minh Bang
  • 51
  • 1
  • 3
  • 9

0 Answers0