Skip to Content

Deprecated

copyText()

Copy text to the user’s clipboard.

JavaScript December 22, 2018

Deprecated

Usage

JavaScript
copyText(string, callback)

Parameters

string
(Required) ( String) The string to be copied to the clipboard
Default: None

callback
(Required) (function) A function to run after text is copied.
Default: None

Request or provide clarification »

Additional Notes

This function has been deprecated in favor of the Async Clipboard API.

This function stores the text into a hidden div until it is copied. The callback function has a passed boolean parameter whether the copy command was successful.