Skip to content

Instantly share code, notes, and snippets.

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);'copied clipboard', 'blue');
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