-
-
Save hallvors/8589631 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var btn = document.getElementById("copy-button"); | |
btn.addEventListener("click", clickHandler, false); | |
function clickHandler(e) { | |
document.exeCommand('copy'); | |
} |
(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
Good point @JamesMGreene - updated gist, still wondering if we could get around that stupid gotcha.. :-(