Spaces:
Sleeping
Sleeping
correcion en funciones js
Browse files- app/index.php +11 -11
app/index.php
CHANGED
|
@@ -12,23 +12,23 @@ $nombre = "Norberto";
|
|
| 12 |
|
| 13 |
<div class="contador">
|
| 14 |
<span class="numero">0</span>
|
| 15 |
-
<button onclick="
|
| 16 |
-
<button onclick="
|
| 17 |
</div>
|
| 18 |
|
| 19 |
<script>
|
| 20 |
let contenedorNumero = document.querySelector("numero");
|
| 21 |
let numeroActual= parseInt(contenedorNumero.textContent);
|
| 22 |
|
| 23 |
-
function
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
}
|
| 33 |
|
| 34 |
function mostrarNumero(){
|
|
|
|
| 12 |
|
| 13 |
<div class="contador">
|
| 14 |
<span class="numero">0</span>
|
| 15 |
+
<button onclick="aumentar">Aumenta</button>
|
| 16 |
+
<button onclick="disminuir">Disminuye</button>
|
| 17 |
</div>
|
| 18 |
|
| 19 |
<script>
|
| 20 |
let contenedorNumero = document.querySelector("numero");
|
| 21 |
let numeroActual= parseInt(contenedorNumero.textContent);
|
| 22 |
|
| 23 |
+
function aumentar(){
|
| 24 |
+
numeroActual++;
|
| 25 |
+
mostrarNumero();
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
function disminuir(){
|
| 29 |
+
if (numeroActual == 0) {return}
|
| 30 |
+
numeroActual--;
|
| 31 |
+
mostrarNumero();
|
| 32 |
}
|
| 33 |
|
| 34 |
function mostrarNumero(){
|