Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Copy the text to the clipboard
/**
* Copy the text to the clipboard
*
* @Param {String} : copy text
* @Param {String} : prompt message
* @Return void
*/
var copyClipboard = function(str, msg)
{
if (window.clipboardData)
{
window.clipboardData.setData('Text',str);
self.alert.open('copied clipboard', 'blue');
}
else
{
var result = prompt((msg) ? msg : "Press Ctrl+C to copy to your clipboard", str);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.