Created
May 5, 2022 20:38
-
-
Save koficoud/c131c5672b9214e1b3b138c760c4ceb1 to your computer and use it in GitHub Desktop.
Agregamos un listener
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
// guardamos la referencia del contenedor donde mostraremos la imagen | |
const previewEl = document.querySelector('#preview'); | |
// guardamos la referencia del input donde se cargará la imagen | |
const inputEl = document.querySelector('#image'); | |
// agregamos el escuchador para detectar cambios | |
inputEl.addEventListener('change', function () { | |
// el código dentro de esta función anónima | |
// se ejecutara, cada vez que se detecte un cambio | |
// en el input | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment