This article mainly introduces the usage of clipboardData objects in javascript, and analyzes the functions and related usage skills of clipboardData objects in detail. For more information about clipboardData objects, see the example in this article. Share it with you for your reference. The specific analysis is as follows:
ClipboardData object. Note that only the Text type can be set on the clipboard on the webpage, that is, only the Text can be copied.
ClearData ("Text") clears clipboard
GetData ("Text") reads the clipboard value
SetData ("Text", val) sets the clipboard value
When the copy operation is performed, the oncopy event of the body is triggered. direct return false indicates that copying is prohibited. Note that the text in the webpage cannot be copied.
Many elements also have oncopy and onpaste events.
1. copy the text to the clipboard.