<div style="height:1px; width:1px; overflow:hidden; position:absolute;left:-2px;">
<input type="text" id="copybox" value="" />
</div>
js:
$("#copybox").val("要复制的内容");
var str = $("#copybox");
str.select();
document.execCommand("Copy");
2023-08-21 15:39:34
<div style="height:1px; width:1px; overflow:hidden; position:absolute;left:-2px;">
<input type="text" id="copybox" value="" />
</div>
js:
$("#copybox").val("要复制的内容");
var str = $("#copybox");
str.select();
document.execCommand("Copy");