Where "DataFormat" may be either "Text" or "URL". If it is "Text" then it gets the data formatted as text and if it is "URL" then it gets the data formatted as a URL.
Description of code:
In our example code we have created two functions for copying data and pasting data to the described text area. These two functions copyData() and pasteData() is called when user clicks on the buttons Copy and Paste. Before copying data we need to select the data otherwise in the clipboardData object "null" value would be set and it will be further pasted to the text area. Here is the following html example code for getDataExample method as follows :
Select the data to which you want to copy.
Click on the Copy button to get data which is selected by you and now click on the Paste button to paste the copied text data to the text area.
You can also download the full source code from the provided link as given below.