Last active
March 17, 2020 15:43
-
-
Save seunggabi/7ae53c100d647cb19c48047cff9b7019 to your computer and use it in GitHub Desktop.
copy.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
<style> | |
.blind { | |
overflow: hidden; | |
position: absolute; | |
clip: rect(0 0 0 0); | |
width: 1px; | |
height: 1px; | |
margin: -1px; | |
} | |
</style> | |
<textarea id="copy" class="blind" readonly> | |
your copy text here! | |
</textarea> | |
<script> | |
copyClipboard(document.getElementById('copy')); | |
function copyClipboard(el) { | |
el.select(); | |
window.document.execCommand('copy'); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment