我按了一个按钮:
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"
我希望你能得到这个想法,我希望有人可以帮助我。