From d5979f13db66a12e8ff7fb0b8dae1202e808ac58 Mon Sep 17 00:00:00 2001 From: Geronimo Hidalgo <45217034@terciariourquiza.edu.ar> Date: Thu, 21 May 2026 18:33:46 -0300 Subject: [PATCH 1/6] Cree una funcion para cambiar h1 --- ejercicios-clase-8.js | 6 ++++++ index.html | 1 + 2 files changed, 7 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index af39c43..b238229 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -1 +1,7 @@ // Vincular este archivo al archivo index.html, y resolver aquí los ejercicios. + +// Ejercicio 1 +const changeText = (str) => { + const h1 = document.querySelector("h1"); + h1.textContent = str; +} diff --git a/index.html b/index.html index 0c393ac..ebffcd8 100644 --- a/index.html +++ b/index.html @@ -32,4 +32,5 @@

Este es otro párrafo del montón.

+ -- 2.49.1 From 868cf5a5fdd5e5c471984cbbfe4b91c03d8d86eb Mon Sep 17 00:00:00 2001 From: Geronimo Hidalgo <45217034@terciariourquiza.edu.ar> Date: Thu, 21 May 2026 18:58:27 -0300 Subject: [PATCH 2/6] Cree una funcion para agregar una clase personalizada --- ejercicios-clase-8.js | 8 ++++++++ estilo.css | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index b238229..5dbc8c9 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -5,3 +5,11 @@ const changeText = (str) => { const h1 = document.querySelector("h1"); h1.textContent = str; } + +// Ejercicio 2 +const addClass = (className) => { + const itemLista = document.querySelectorAll("li"); + itemLista.forEach((item) => { + item.classList.add(className); + }); +} diff --git a/estilo.css b/estilo.css index fcb26fc..e55df68 100644 --- a/estilo.css +++ b/estilo.css @@ -101,6 +101,14 @@ h1 { font-weight: bold; } +/* Clase item-lista */ +.item-lista { + background: #fff4d6; + border-color: #f4b400; + color: #7a5200; + font-weight: bold; +} + /* ========================= IMAGEN ========================= */ -- 2.49.1 From 8b352de3f321a2ca4e6dd256328ef18ad07cf89c Mon Sep 17 00:00:00 2001 From: Geronimo Hidalgo <45217034@terciariourquiza.edu.ar> Date: Thu, 21 May 2026 19:26:01 -0300 Subject: [PATCH 3/6] Cree una funcion para poder agregar text a una lista --- ejercicios-clase-8.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 5dbc8c9..d611b6d 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -13,3 +13,11 @@ const addClass = (className) => { item.classList.add(className); }); } + +// Ejercicio 3 +const agregarItem = (text) =>{ + const list = document.querySelector("#lista-inicial"); + const newLi = document.createElement("li"); + newLi.textContent = text; + list.appendChild(newLi); +} -- 2.49.1 From c6e86eecc961446b8010d73e0e64919027a913b7 Mon Sep 17 00:00:00 2001 From: Geronimo Hidalgo <45217034@terciariourquiza.edu.ar> Date: Mon, 25 May 2026 17:53:52 -0300 Subject: [PATCH 4/6] Cree un selector de parrafos que agrega la palabra destacado --- ejercicios-clase-8.js | 46 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index d611b6d..0cf5a04 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -15,9 +15,53 @@ const addClass = (className) => { } // Ejercicio 3 -const agregarItem = (text) =>{ +const agregarItem = (text) => { const list = document.querySelector("#lista-inicial"); const newLi = document.createElement("li"); newLi.textContent = text; list.appendChild(newLi); } + +// Ejercicio 4 +const parrafos = document.querySelectorAll("#parrafos p"); + +parrafos.forEach((p) => { + if (p.textContent.toLowerCase().includes("importante")){ + p.classList.add("destacado"); + } +}); + +// Ejercicio 5 +const agregarSec = () => { + const div = document.createElement("div"); + const body = document.querySelector("body"); + body.appendChild(div); + + const h2 = document.createElement("h2"); + h2.textContent = "Comidas tipicas del litoral"; + div.appendChild(h2); + + const parrafo = document.createElement("p"); + parrafo.textContent = "El litoral tiene una gran variedad de Exquisiteses aqui les presentamos algunas de ellas"; + div.appendChild(parrafo); + + const ul = document.createElement("ul"); + const comidas = ["Chipa","Sopa paraguaya","Pacu","Surubi","Mbeju"]; + comidas.forEach((comida) => { + const li = document.createElement("li"); + li.textContent = comida; + ul.appendChild(li); + }); + + div.appendChild(ul); +} + +// Ejercicio 6 +const limpiarList = (id) => { + const limpiar = document.getElementById(id); + while(limpiar.firstChild){ + limpiar.removeChild(limpiar.firstChild); + } +} + + -- 2.49.1 From cfa41d97e9226e4b5bf0fe6ba949164841d37ddd Mon Sep 17 00:00:00 2001 From: Geronimo Hidalgo <45217034@terciariourquiza.edu.ar> Date: Mon, 25 May 2026 18:02:38 -0300 Subject: [PATCH 5/6] Cree una funcion que cambia la imagen --- ejercicios-clase-8.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 0cf5a04..5fc710d 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -64,4 +64,11 @@ const limpiarList = (id) => { } } +// Ejercicio 7 +const cambiarImg = () => { + const img = document.querySelector("img"); + img.src = "foto2.jpg"; + img.alt = "Locro"; +} + -- 2.49.1 From 02470dcaa6734ff2660815366f3c881986a4e348 Mon Sep 17 00:00:00 2001 From: Geronimo Hidalgo <45217034@terciariourquiza.edu.ar> Date: Mon, 25 May 2026 18:26:09 -0300 Subject: [PATCH 6/6] Cree una funcion para construir listas --- ejercicios-clase-8.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 5fc710d..f0c3315 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -71,4 +71,20 @@ const cambiarImg = () => { img.alt = "Locro"; } +// Ejercicio 8 +const construirlist = (array) => { + const div = document.createElement("div"); + div.classList.add("grupo-comidas"); + const h2 = document.createElement("h2"); + h2.textContent = array[0]; + const ul = document.createElement("ul"); + for (let i = 1; i < array.length; i++){ + const li = document.createElement("li"); + li.textContent = array[i]; + ul.appendChild(li); + }; + div.appendChild(ul); + return div; +} + -- 2.49.1