File size: 395 Bytes
4d78433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
}