var v = document.getElementById("forcopy").value;

window.clipboardData.setData('text',v);

alert("复制成功!");
<input id="forcopy" name="forcopy" type="text" value="www.9158.com" onclick="copy()">

<input type="text"  >

 

相关文章:

  • 2022-12-23
  • 2021-06-03
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2022-12-23
猜你喜欢
  • 2022-01-15
  • 2021-12-21
  • 2021-04-19
  • 2022-12-23
  • 2021-07-04
相关资源
相似解决方案