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 },

 

posted @ 2020-06-04 16:27  zhishaofei3  阅读(204)  评论(0编辑  收藏  举报