Created
August 13, 2019 23:59
-
-
Save parzibyte/e63614f563ab0dc4c1f5fe7c414c4161 to your computer and use it in GitHub Desktop.
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
const $btnCompartir = document.querySelector("#btnCompartir"), | |
$texto = document.querySelector("#texto"); | |
$btnCompartir.addEventListener("click", () => { | |
let mensaje = $texto.value; | |
if (!mensaje) return alert("Escribe algo"); | |
window.open("https://api.whatsapp.com/send?text=" + encodeURIComponent(mensaje)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment