Created
January 8, 2022 17:53
-
-
Save uncledevhq/c0e4cf0c0481f8e7a9d094912a5bf066 to your computer and use it in GitHub Desktop.
copy text 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
// console.log("thenxtlvls", 2022); | |
function copyContentToClipboard (content) { | |
console.log(content, "to be copied") | |
navigator.clipboard.writeText(content).then(function() { | |
alert("text copied to clipboard") | |
}, function() { | |
alert("Oops! Couldnt copy text to clipboard") | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment