JavaScript Reference/Javascript Objects/clipboardData

Материал из Web эксперт
Перейти к: навигация, поиск

"clipboardData" Example

    
<html>
<body>
<button onclick="window.clipboardData.setData("text", "This is sample text");">
Copy sample text to clipboard
</button>
<button onclick="alert(window.clipboardData.getData("text"));">
Display data copied to clipboard
</button>
</body>
</html>



"clipboardData" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |window                                                        |
+----------------+--------------------------------------------------------------+



"clipboardData" JavaScript Methods

+----------------+--------------------------------------------------------------+
| JavaScript     |clearData                       getData                       |
| Methods        |setData                                                       |
+----------------+--------------------------------------------------------------+



"clipboardData" Syntax and Note

Note:
Transfer data to and from the clipboard. 
Its methods, clearData(), getData(), and setData(), 
perform the actions cut, copy, and paste, respectively.
    
Syntax:
    
window.clipboardData.memberName