window.clipboardData can realize the copy and paste operations, its getData method can realize the reading of data, and the setData method can realize the setting of data
<script language="javascript"> function readTxt() { alert(window.clipboardData.getData("text")); } function setTxt() { var t=document.getElementById("txt"); t.select(); window.clipboardData.setData('text',t.createTextRange().text); } </script> <input name="txt" value="test"> <input type="button" value="copy" onclick="setTxt()"> <input type="button" value="read" onclick="readTxt()">