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) diff --git a/2-dom-manipulation/form.html b/2-dom-manipulation/form.html new file mode 100644 index 0000000..0e47359 --- /dev/null +++ b/2-dom-manipulation/form.html @@ -0,0 +1,51 @@ + + + + + + + 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..fb60499 --- /dev/null +++ b/2-dom-manipulation/form.js @@ -0,0 +1,46 @@ +function validaTeForm(event){ + event.preventDefault(); + console.log('Datos Ingresados'); + +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