html:
<a href="javascript:;" id="copyBtn" class="f-r tac" data-clipboard-text="111" data-clipboard-action="copy" >点击复制ID</a>
js:
var clipboard = new Clipboard("#copyBtn");
clipboard.on('success', function(e) {
alert("已复制");
});
clipboard.on('error', function(e) {
alert("请重试");
});