简单几句实现复制功能(JS)

      const input=document.createElement('input')
      document.body.appendChild(input)
      input.setAttribute('value','啦啦啦')//啦啦啦=》是要Copy的值
      input.select()
      document.execCommand('copy')
      //然后就可以直接Ctrl+V 啦
原文地址:https://www.cnblogs.com/alives/p/14218162.html