Skip to Content
Menu

Deprecated

selectText()

Select (and optionally copy) text.

JavaScript December 22, 2018

Deprecated

Usage

JavaScript
selectText(element, copy, callback)

Parameters

element
(Required) (String/Selector) The element whose text to highlight
Default: None

copy
(Optional) (Boolean) Copy the selected text to the clipboard
Default: None

callback
(Optional) (Function) A function to run after select/copy.
Default: None

Parameter Notes

The callback function passes a boolean parameter if the copy was successful.

Request or provide clarification »

Additional Notes

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

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!