shaobog
<script type="text/javascript">
function copyUrl2()
    {
        var Url2=document.getElementById("biao1").innerText;
        var oInput = document.createElement(\'input\');
        oInput.value = Url2;
        document.body.appendChild(oInput);
        oInput.select(); // 选择对象
        document.execCommand("Copy"); // 执行浏览器复制命令
        oInput.className = \'oInput\';
        oInput.style.display=\'none\';
        alert(\'复制成功\');
    }
</script>
<div cols="20" id="biao1">12345678</div>
<input type="button" onClick="copyUrl2()" value="点击复制代码" />

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-12-03
  • 2022-12-23
  • 2021-12-10
猜你喜欢
  • 2022-12-23
  • 2021-12-03
  • 2022-01-04
  • 2022-12-23
  • 2021-10-18
相关资源
相似解决方案