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>
相關文章
相關標籤/搜索