Created
August 8, 2019 02:17
-
-
Save parzibyte/c0591ef824225de31ac41c645b72d332 to your computer and use it in GitHub Desktop.
Escribir en portapapeles con JavaScript - https://parzibyte.me/blog/2018/08/24/acceder-al-portapapeles-con-javascript/
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
navigator.clipboard.writeText("Soy un texto copiado al portapapeles") | |
.then(() => { | |
console.log("El texto ha sido copiado :-)"); | |
}) | |
.catch(error => { | |
// Por si el usuario no da permiso u ocurre un error | |
console.log("Hubo un error: ", error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment