js实现复制(转)
function copyText() {
var ctx = document.createElement("input");
var content = "需要复制的内容";
ctx.setAttribute("value", content);
document.body.appendChild(ctx);
ctx.select();
document.execCommand("copy");
document.body.removeChild(ctx);
}
转至:https://cloud.tencent.com/developer/article/1697532?from=15425