forked from marquez.juan/clase-9-eventos
feat: add click counter button interaction
This commit is contained in:
12
clase-9.js
12
clase-9.js
@@ -1 +1,13 @@
|
||||
// Agregar acá el código javascript para los ejercicios
|
||||
|
||||
// Ejercicio 1
|
||||
|
||||
const clickCounter = document.getElementById('clickCounter');
|
||||
const clickButton = document.getElementById('clickButton');
|
||||
|
||||
let count = 0;
|
||||
|
||||
clickButton.addEventListener('click', () => {
|
||||
count++;
|
||||
clickCounter.textContent = count;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user