html: (直接上紮實的數據,框子本身搭建)javascript
<script type="text/javascript" src="../../js/jquery.min.js"></script>html
<script type="text/javascript" src="../../js/clipboard.min.js"></script>//src根據項目實際狀況而定java
<button type="button" class="btn btn-primary copy_jq" id="copy" data-clipboard-text="size" onclick="return copyFun(copy,'https://www.baidu.com/')" >跳轉</button>;jquery
jquery:url
function copyFun(id,url){ var clipboard = new Clipboard(".copy_jq");//能夠用id,也能夠用class clipboard.on('success', function(e) { window.open(Url);//打開新窗口頁面 });}