复制内容到剪贴板

80 阅读1分钟

<script type="text/javascript">\

function copyUrl(url){
var oInput = document.createElement('input');
oInput.value = url;
document.body.appendChild(oInput);
oInput.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令
oInput.className = 'oInput';
oInput.style.display='none';
tishi('${context_path}','1','复制成功!');\

    }

</script>

<a href="javascript:void(0)" οnclick="copyUrl('${data.url}')">复制</a>

\