JS复制文字到剪贴板

1 function copyItem() {
2   const input = document.createElement('input')
3   input.type = 'text'
4   input.value = ''
5   document.body.appendChild(input)
6   input.select()
7   document.execCommand("Copy")
8   document.body.removeChild(input)
9 },
原文地址:https://www.cnblogs.com/zhishaofei/p/13044354.html