js 点击复制代码 window.clipboardData.setData
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" >