debian-perritos / app /main.js
chartManD's picture
remarcar nombre
4d78433
Raw History Blame Contribute Delete
395 Bytes
let contenedorNumero = document.getElementById("numero");
let numeroString = contenedorNumero.textContent;
let numeroActual = parseInt(numeroString);
function aumentar() {
numeroActual++;
mostrarNumero();
}
function disminuir() {
if (numeroActual == 0) {
return;
}
numeroActual--;
mostrarNumero();
}
function mostrarNumero() {
contenedorNumero.textContent = numeroActual;
}