Skip to main content

copyToClipboard()

The copyToClipboard() function copies the given string to the user's clipboard. This page provides information about the function and its parameters.

Signature

copyToClipboard(data: string, { debug: boolean, format: string }): Promise

Parameters

data

The string contains the text data copied to the clipboard.

debug

The default value is false. When set to true, this option displays the information in the console. The parameter can be helpful for debugging.

format

The string specifies the MIME type of the copied text. The parameter can be helpful when using specialized content types, such as application/json.