<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>target-input</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!-- 1. Define some markup -->
<input id="foo" type="text" value="hello111">
<button class="btn" data-clipboard-action="copy" data-clipboard-target="#foo">Copy</button> <br><br>
<input id="foo2" type="text" value="hello222">
<button class="btn" data-clipboard-action="copy" data-clipboard-target="#foo2">Copy</button> <br><br>
<input id="foo3" type="text" value="hello333">
<button class="btn" data-clipboard-action="copy" data-clipboard-target="#foo3">Copy</button> <br><br>
<input id="foo4" type="text" value="hello444">
<button class="btn" data-clipboard-action="copy" data-clipboard-target="#foo4">Copy</button>
<!-- 2. Include library -->
<script src="dist/clipboard.min.js"></script>
<!-- 3. Instantiate clipboard -->
<script>
var clipboard = new Clipboard('.btn');
clipboard.on('success', function(e) {
console.log(e);
});
clipboard.on('error', function(e) {
console.log(e);
});
</script>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
复制粘贴功能,简单实用
共7个文件
js:6个
html:1个
需积分: 5 0 下载量 157 浏览量
2024-05-12
18:46:53
上传
评论
收藏 12KB ZIP 举报
温馨提示
复制粘贴功能,简单实用,非常好用
资源推荐
资源详情
资源评论
收起资源包目录
复制插件.zip (7个子文件)
复制插件
src
clipboard-action.js 6KB
clipboard.js 3KB
dist
clipboard.js 24KB
clipboard.min.js 0B
index.html 1KB
test
clipboard-action.js 7KB
clipboard.js 4KB
共 7 条
- 1
资源评论
qq_26021017
- 粉丝: 0
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功