jQuery实现点击复制效果

<!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>


<input id="foo" type="text" value="hello">
<button class="btn" data-clipboard-action="copy" data-clipboard-target="#foo">Copy</button>

<script src="../extend/copy/clipboard.min.js"></script>

<script>
     var clipboard = new Clipboard('.btn');
</script>


</body>

</html>

 

 

2019-03-13

posted @ 2019-03-13 18:54  鸟人一个  阅读(8072)  评论(0编辑  收藏  举报