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" >
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" >