Skip to Content
Menu

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.

Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!