Skip to content
GitLab
Explore
Sign in
This is an archived project. Repository and other project resources are read-only.
A17
a17-helpers
Wiki
copyTextToClipboard
copyTextToClipboard
· Changes
Page history
docs all using *.md fileformat
authored
Mar 07, 2018
by
Mike Byrne
Hide whitespace changes
Inline
Side-by-side
copyTextToClipboard.md
0 → 100644
View page @
cd38ef7c
# copyTextToClipboard
## description
Copies a string to the clipboard, if successful shows an alert with a message
## requires
*
nothing
## parameters
*
textToCopy - required - string of text to copy
*
successMsg - optional - string of text to display in the alert if successful, default says "Copied to clipboard"
## returns
*
nothing
## example usage:
```
js
var
stringToCopy
=
"
Hello World
"
;
copyTextToClipboard
(
stringToCopy
);
```
## thanks to:
http://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript#answer-30810322