javascipt浏览器复制文本

   // value 要复制的内容
   function copyTitle (value) {
      let input = document.createElement('input')
      document.body.appendChild(input)
      input.value = value
      input.select()
      document.execCommand('Copy')
      document.body.removeChild(input)
     alert('复制成功')
    }

 

posted @ 2021-06-10 16:01  那个村  阅读(47)  评论(0)    收藏  举报