js 复制 浏览器 点击 copy

<textarea id="input" style="100%">{:url('login/index',['invite'=>$Think.session.user.uid], 'html', true)}</textarea>
<script>
    function copyText() {
      
      var input = document.getElementById("input");
      
      input.select(); // 选中文本
      document.execCommand("copy"); // 执行浏览器复制命令

    }
</script>
原文地址:https://www.cnblogs.com/shaoing/p/8986576.html