Created
July 31, 2021 08:21
-
-
Save hahwul/64a6ecb6a275268fa34dfda89a77fa3f to your computer and use it in GitHub Desktop.
copy to clipboard
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
function copy(val) { | |
const t = document.createElement("textarea"); | |
document.body.appendChild(t); | |
t.value = val; | |
t.select(); | |
document.execCommand('copy'); | |
document.body.removeChild(t); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment