JavaScript can easily manipulate client clipboard content, but it is only applicable to browsers above IE5.
JavaScript can use objects to process clipboard content.
Method setData(param1, param2) to save to clipboard.
param1 : data type text or URL, etc.
param2: Data content.
How to read data from the clipboard getdata(param1)
Method to clear data clearData(param1)
<HTML> <HEAD> <TITLE>Test operation clipboard</TITLE> </HEAD> <script> function copyToClipboard() { var d=("source").value; ('text',d); } </script> <BODY> <button onclick="copyToClipboard();">copy</button> <input type="text" size=20 value="Test data"> <br> <button onclick="alert(('text'));">show</button> <button onclick="('text');">Clear</button> </BODY> </HTML> Here is another example to implement the selected characters in the page,and drag to text area function。Note that the objects can also handle clipboard content,But only used in drag-and-drop In operation。 <HTML> <HEAD> <TITLE>Test operation clipboard2</TITLE> </HEAD> <script> function transferDrop() { = ("text"); = false; } function transferDrag() { = 'move'; = false; } </script> <BODY> <p ondragstart=" = 'move';">Select us and drag us to thetextarea</p> <textarea ondrop="transferDrop();" ondragover=" = false;" ondragenter="transferDrag();"> </textarea> </BODY> </HTML>