jQuery.paste()Returns: Boolean
Description: Pastes clipboard contents to text field.
-
version added: w0.2jQuery.paste()
-
This method does not accept any arguments.
-
Note: This function is only availible in the withPaste version of jQlipboard.
This is functionally identical to using navigaror.clipboard.writeText()
(or document.execCommand
if available in the user's browser) or simply pressing Ctrl + V. Upon a successful execution, this function will return true
.
Consider the following example:
1
2
3
4
5
6
7
|
|
The textfield will be focused. From there, we can call the paste function.
1
|
|
The conetnts of the clipboard will be pasted into the textfield, if a paste can be perfeormed. This process will work as if you pasted by right-clicking or by using keyboard shortcuts, but will not invote a pasting event listener.