Created
July 6, 2018 06:04
-
-
Save sharapeco/1eea2d1233a653b7a390a99c5ad84def to your computer and use it in GitHub Desktop.
pbcopy.js
This file contains hidden or 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
function pbcopy(s,d,e,l,a){ | |
d=document;a="appendChild";e=d.createElement("div");e[a](d.createElement("pre")).textContent=s; | |
l=e.style;l.position="fixed";l.left="-100%";d.body[a](e);d.getSelection().selectAllChildren(e); | |
l=d.execCommand("copy");d.body.removeChild(e);return l} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment