From e1dcf6db72537ea11675646aa224dc3f500dd7ff Mon Sep 17 00:00:00 2001 From: Eugenio Zapata <37448644@terciariourquiza.edu.ar> Date: Mon, 25 May 2026 21:07:50 -0300 Subject: [PATCH] ejercicio 8 --- ejercicios-clase-8.js | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 08c3f91..e1834b2 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -83,7 +83,36 @@ function limpiarLista(idDeLaLista){ const imagen = document.querySelector("img"); -console.log(imagen.getAttribute("src")); imagen.setAttribute("src", "foto2.jpg"); imagen.setAttribute("alt", "Locro"); -console.log(imagen.getAttribute("alt")); \ No newline at end of file + +//ejercicio 8 + +const construirLista1 = (["Comidas mendocinas", "Sopaipilla", "Vino tinto"]); + +function construirLista(){ + const listaComidaMendoza = Array.from(construirLista1).filter(palabra => palabra.length) + + if(listaComidaMendoza.length > 0){ + const div1 = document.createElement("div"); + div1.classList.add("grupo-comidas"); + + const miH2 = document.createElement("h2"); + miH2.textContent = listaComidaMendoza[0]; + div1.appendChild(miH2); + + const agregarUl = document.createElement("ul"); + agregarUl.classList.add("Comidas-mendocinas"); + + const agregarLi = document.createElement("li"); + agregarLi.textContent = listaComidaMendoza[1]; + agregarUl.appendChild(agregarLi); + + const agregarLi2 = document.createElement("li"); + agregarLi2.textContent = listaComidaMendoza[2]; + agregarUl.appendChild(agregarLi2); + + div1.appendChild(agregarUl); + document.body.appendChild(div1); + } +} \ No newline at end of file