clipboard.min.js 复制表格内容
<script type="text/javascript" src="js/clipboard.min.js"></script>
<button id="btn_copy" data-clipboard-action="copy" data-clipboard-target=".tableList">复制表格内容</button> <!-- <input type="button" class="input_button_blue" id="btn_copy" data-clipboard-action="copy" data-clipboard-target=".tableList" value="复制"></input>-->
<script> var clipboard = new ClipboardJS('#btn_copy'); clipboard.on('success', function(e) { e.clearSelection();//清除选择涂黑显示 alertMsg("复制成功!",1); }); clipboard.on('error', function(e) { alertMsg("复制失败,请刷新后重试!",1); }); </script>
<table class='tableList' >.......表格内容.....</table>