From b5461b9128a5dc89b3ceac6795f0c75c71f837a1 Mon Sep 17 00:00:00 2001 From: mayravargasbecerra13 Date: Thu, 28 Jul 2022 16:48:36 -0500 Subject: [PATCH 1/4] Agrego primer ejercicio de javarcript --- 1-syntax-basic-constructs/basic-js.html | 15 +++++++++++++++ 1-syntax-basic-constructs/basic.js | 9 +++++++++ 2 files changed, 24 insertions(+) create mode 100644 1-syntax-basic-constructs/basic-js.html create mode 100644 1-syntax-basic-constructs/basic.js diff --git a/1-syntax-basic-constructs/basic-js.html b/1-syntax-basic-constructs/basic-js.html new file mode 100644 index 0000000..a6518b5 --- /dev/null +++ b/1-syntax-basic-constructs/basic-js.html @@ -0,0 +1,15 @@ + + + + + + + Document + + + + + + + + \ No newline at end of file diff --git a/1-syntax-basic-constructs/basic.js b/1-syntax-basic-constructs/basic.js new file mode 100644 index 0000000..8054ffe --- /dev/null +++ b/1-syntax-basic-constructs/basic.js @@ -0,0 +1,9 @@ +const edad = prompt ('Ingrese su edad:') +function mayorEdad(edad) { + if (edad > 18 ){ + alert('mayor edad') +}else { + alert('Es menor de edad') +} +} +mayorEdad(edad) From 06d11d80b720ad3855f1eeba19b9a4c01ac295fd Mon Sep 17 00:00:00 2001 From: mayravargasbecerra13 Date: Tue, 2 Aug 2022 16:16:35 -0500 Subject: [PATCH 2/4] Agrego Dom a mi formulario --- 2-dom-manipulation/form.html | 50 ++++++++++++++++++++++++++++++++++++ 2-dom-manipulation/form.js | 7 +++++ 2 files changed, 57 insertions(+) create mode 100644 2-dom-manipulation/form.html create mode 100644 2-dom-manipulation/form.js diff --git a/2-dom-manipulation/form.html b/2-dom-manipulation/form.html new file mode 100644 index 0000000..b8c8357 --- /dev/null +++ b/2-dom-manipulation/form.html @@ -0,0 +1,50 @@ + + + + + + + Formulario de validación + + + +
+ + + +
+ + + +
+ Mujer + Hombre
+ +

Estrato

+ + +

Hobbis

+ +
+ +
+ +
+ +
+ + + +
+ + + + + \ No newline at end of file diff --git a/2-dom-manipulation/form.js b/2-dom-manipulation/form.js new file mode 100644 index 0000000..ef386a5 --- /dev/null +++ b/2-dom-manipulation/form.js @@ -0,0 +1,7 @@ +function validaTeForm(event){ + event.preventDefault(); + console.log('Datos Ingresados'); + } + + const form = document.querySelector('form'); + form.addEventListener('submit', validaTeForm); \ No newline at end of file From 8086e474e2c6fcb1eda5ff6145acbc7852d9b1e6 Mon Sep 17 00:00:00 2001 From: mayravargasbecerra13 Date: Tue, 2 Aug 2022 16:41:58 -0500 Subject: [PATCH 3/4] agrego dom a formulario --- 2-dom-manipulation/form.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2-dom-manipulation/form.html b/2-dom-manipulation/form.html index b8c8357..59caf4f 100644 --- a/2-dom-manipulation/form.html +++ b/2-dom-manipulation/form.html @@ -10,9 +10,9 @@
- + -
+
From 1056f6280414c91ff80f2fb406e7d8eff0533191 Mon Sep 17 00:00:00 2001 From: mayravargasbecerra13 Date: Wed, 3 Aug 2022 17:25:56 -0500 Subject: [PATCH 4/4] Agrego Dom a mi formulario --- 2-dom-manipulation/form.html | 35 ++++++++++++++-------------- 2-dom-manipulation/form.js | 45 +++++++++++++++++++++++++++++++++--- 2 files changed, 60 insertions(+), 20 deletions(-) diff --git a/2-dom-manipulation/form.html b/2-dom-manipulation/form.html index 59caf4f..0e47359 100644 --- a/2-dom-manipulation/form.html +++ b/2-dom-manipulation/form.html @@ -8,39 +8,40 @@ - + - + -
+
- +
- Mujer - Hombre
+ min="2018-01-01" max="2022-12-31" >
+ Mujer + Hombre

Estrato

- + + + + +

Hobbis

-
+
-
+
-
+
-
+
- + diff --git a/2-dom-manipulation/form.js b/2-dom-manipulation/form.js index ef386a5..fb60499 100644 --- a/2-dom-manipulation/form.js +++ b/2-dom-manipulation/form.js @@ -1,7 +1,46 @@ function validaTeForm(event){ event.preventDefault(); console.log('Datos Ingresados'); - } - const form = document.querySelector('form'); - form.addEventListener('submit', validaTeForm); \ No newline at end of file +const name = document.querySelector('#myname') + +const mail = document.querySelector('#email-form').value +console.log(mail) + +const genero = document.querySelector('input[name="sexo"]:checked'); +if(genero) { + alert(genero.value); +} else { + alert('No hay ninún elemento activo'); +} + +const hobbys = document.querySelector('input[name="chek"]:checked'); +if(hobbys) { + alert(hobbys.value); +} else { + alert('Seleccione su Hobby'); +} + +const select = document.querySelector('#estrato'); +let valueselect = select.value; +console.log(valueselect); + +if (name.value === "" ) { +alert('El campo es requerido') +} + +} + +const form = document.querySelector('form'); + form.addEventListener('submit', validaTeForm); + + + + + + + + + + + \ No newline at end of file