Inicio de la clase 9 #9

Open
maderademarco.sergio wants to merge 6 commits from maderademarco.sergio/clase-9-eventos:ejercicio-9 into main
Showing only changes of commit 0de98801ca - Show all commits

View File

@@ -30,3 +30,24 @@ listaItems.addEventListener('click', function(event) {
});
item.classList.add('seleccionado');
});
// Ejercicio 4 - Bubbling y capturing
const externo = document.getElementById('externo');
const interno = document.getElementById('interno');
const botonCaptura = document.getElementById('botonCaptura');
externo.addEventListener('click', function() {
console.log('bubbling: externo');
});
interno.addEventListener('click', function() {
console.log('bubbling: interno');
});
botonCaptura.addEventListener('click', function() {
console.log('bubbling: button');
});
externo.addEventListener('click', function() {
console.log('capturing: externo');
}, true);