Skip to content

Instantly share code, notes, and snippets.

@hallvors
Forked from JamesMGreene/clipboard.js
Last active January 4, 2016 07:38
Show Gist options
  • Save hallvors/8589631 to your computer and use it in GitHub Desktop.
Save hallvors/8589631 to your computer and use it in GitHub Desktop.
var btn = document.getElementById("copy-button");
btn.addEventListener("click", clickHandler, false);
function clickHandler(e) {
document.exeCommand('copy');
}
@hallvors
Copy link
Author

hallvors commented May 8, 2015

(Synthetic events were not the way to go - document.execCommand('copy') is the old new thing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment