62,047
社区成员
发帖
与我相关
我的任务
分享
function copyCallback(text) {
var input = document.createElement('input');
input.setAttribute('id', "copyInput");
input.setAttribute('value', text);
document.getElementsByTagName('body')[0].appendChild(input);
document.getElementById("copyInput").select();
if (document.execCommand('copy')) {
document.getElementById("copyInput").remove();
}
else {
document.getElementById("copyInput").remove();
}
}