diff --git a/ejercicio1.html b/ejercicio1.html new file mode 100644 index 0000000..32919f5 --- /dev/null +++ b/ejercicio1.html @@ -0,0 +1,52 @@ + + + + + + + + + + + + + Ejercicio 1 + + + +

Ejercicio 1

+

Ingresa 3 números del 1 al 100

+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+ + + + +
+ + + + + + + + + + + \ No newline at end of file diff --git a/ejercicio2.html b/ejercicio2.html new file mode 100644 index 0000000..4838ddd --- /dev/null +++ b/ejercicio2.html @@ -0,0 +1,52 @@ + + + + + + + + + + + + + Ejercicio 1 + + + +

Ejercicio 2

+

Ingresa 3 números del 1 al 100

+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+ + + + +
+ + + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html index 12a902b..991738a 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@

Ejercicios

diff --git a/js/main.js b/js/main.js new file mode 100644 index 0000000..1dc450f --- /dev/null +++ b/js/main.js @@ -0,0 +1,37 @@ +let res = document.getElementById("resultado"); + + let btn = document.getElementById("btnValidar"); + + btn.addEventListener("click", function(e){ + e.preventDefault(); + console.log("btn click"); + let a1 = parseInt(document.getElementById("n1").value); + let b1 = parseInt(document.getElementById("n2").value); + let c1 = parseInt(document.getElementById("n3").value); + + let array = [a1,b1,c1]; + + array.sort(); + + res.innerHTML = "El número mayor es " + array[2]; + + }); + + let res2 = document.getElementById("resultado"); + + let btn2 = document.getElementById("btnValidar2"); + + btn.addEventListener("click", function(e){ + e.preventDefault(); + console.log("btn click"); + let a1 = parseInt(document.getElementById("nu1").value); + let b1 = parseInt(document.getElementById("nu2").value); + let c1 = parseInt(document.getElementById("nu3").value); + + let array = [a2,b2,c2]; + + array.sort(); + + res2.innerHTML = "El número menor es " + array[0]; + + }); \ No newline at end of file