ejercicio 5: formulario con validaciones y eventos
This commit is contained in:
21
clase-9.js
21
clase-9.js
@@ -30,3 +30,24 @@ listaItems.addEventListener('click', function(event) {
|
|||||||
});
|
});
|
||||||
item.classList.add('seleccionado');
|
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user