创建复制按钮

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.zclip.js"></script>
<p id="description">这是要复制的内容</p>
<a id="copy-description">复制</a>
<script type="text/javascript">
    $(document).ready(function () {
        $('a#copy-description').zclip({
            path: 'js/ZeroClipboard.swf',
            copy: $('p#description').text()
        });
    })
</script>
</body>
</html>
posted @ 2023-02-21 10:04  Alive_2020  阅读(15)  评论(0编辑  收藏  举报