<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function copyLink(){
var e = document.getElementById("copy");
e.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令
alert("复制链接成功!");
}
</script>
</head>
<body>
<textarea id="copy">复制链接成功</textarea>
<input type="button" onclick="copyLink();" value="点击复制"></input>
</body>
</html>
相关文章:
- js实现点击复制网页内容(基于clipboard.js) 2021-12-20
- js实现点击复制网页内容(基于execCommand) 2021-11-14
- js点击复制,复制你想复制的内容 2022-12-23
- js实现复制内容 2022-12-23
- js插件实现点击复制内容到粘贴板,兼容IE8 2021-09-18
- js实现复制功能 JS 点击复制Copy 2021-12-28
- vue点击复制内容 2022-12-23