From ccab67b2b797d0fe45c71cef86cdb20f85dc7229 Mon Sep 17 00:00:00 2001 From: Nicolas Murua Date: Wed, 13 May 2026 20:11:36 -0300 Subject: [PATCH 1/9] ejercicio 1 --- ejercicios-clase-8.js | 4 ++++ index.html | 1 + 2 files changed, 5 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index af39c43..a95f6ea 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -1 +1,5 @@ // Vincular este archivo al archivo index.html, y resolver aquí los ejercicios. +function cambiarText(texto){ + const textoH1 = document.querySelector("h1"); + textoH1.textContent = texto; +} \ No newline at end of file diff --git a/index.html b/index.html index 0c393ac..64e23af 100644 --- a/index.html +++ b/index.html @@ -31,5 +31,6 @@

¿Y este párrafo? ¿Será importante?

Este es otro párrafo del montón.

+ -- 2.49.1 From 67173a3a9fb968871c3b8bba2b2c9101d15b5913 Mon Sep 17 00:00:00 2001 From: Nicolas Murua Date: Wed, 13 May 2026 20:26:24 -0300 Subject: [PATCH 2/9] ejercicio 2 --- ejercicios-clase-8.js | 7 +++++++ estilo.css | 1 + 2 files changed, 8 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index a95f6ea..de2746c 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -2,4 +2,11 @@ function cambiarText(texto){ const textoH1 = document.querySelector("h1"); textoH1.textContent = texto; +} + +function agregarItem(){ + const listaComida = document.querySelectorAll(".item-comida"); + for (const i of listaComida){ + i.classList.add("item-lista"); + } } \ No newline at end of file diff --git a/estilo.css b/estilo.css index fcb26fc..6c2d1de 100644 --- a/estilo.css +++ b/estilo.css @@ -101,6 +101,7 @@ h1 { font-weight: bold; } + /* ========================= IMAGEN ========================= */ -- 2.49.1 From d6199a07ea87536727d5d57a0d313d117da6c923 Mon Sep 17 00:00:00 2001 From: Nicolas Murua Date: Wed, 13 May 2026 20:29:05 -0300 Subject: [PATCH 3/9] correccion de la funcion del ejercicio 2 --- ejercicios-clase-8.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index de2746c..87a3c1b 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -4,7 +4,7 @@ function cambiarText(texto){ textoH1.textContent = texto; } -function agregarItem(){ +function agregarClase(){ const listaComida = document.querySelectorAll(".item-comida"); for (const i of listaComida){ i.classList.add("item-lista"); -- 2.49.1 From b92b2428a7246014ebb0053cb1a7dcfcdb7e2e32 Mon Sep 17 00:00:00 2001 From: Nicolas Murua Date: Wed, 13 May 2026 20:36:00 -0300 Subject: [PATCH 4/9] ejercicio 3 --- ejercicios-clase-8.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 87a3c1b..144ec6e 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -9,4 +9,14 @@ function agregarClase(){ for (const i of listaComida){ i.classList.add("item-lista"); } +} + +function agregarItem(texto){ + const lista = document.querySelector("#lista-inicial"); + const nuevo = document.createElement("li"); + + nuevo.textContent = texto; + + lista.appendChild(nuevo); + } \ No newline at end of file -- 2.49.1 From 2a0aa2bbc29d5a79cff68b872fde4bfda431bae9 Mon Sep 17 00:00:00 2001 From: Nicolas Murua Date: Wed, 13 May 2026 20:41:05 -0300 Subject: [PATCH 5/9] ejercicio 4 --- ejercicios-clase-8.js | 10 ++++++++++ estilo.css | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 144ec6e..3ee0dcb 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -19,4 +19,14 @@ function agregarItem(texto){ lista.appendChild(nuevo); +} + +function destacarImportantes() { + const parrafos = document.querySelectorAll("#parrafos p"); + + for (const p of parrafos) { + if (p.textContent.includes("importante")) { + p.classList.add("destacado"); + } + } } \ No newline at end of file diff --git a/estilo.css b/estilo.css index 6c2d1de..dc6a0dc 100644 --- a/estilo.css +++ b/estilo.css @@ -144,7 +144,7 @@ h1 { .destacado { background: linear-gradient(135deg, #4a90e2, #357abd); - color: white; + color: rgb(255, 255, 255); font-weight: bold; padding: 18px !important; box-shadow: 0 6px 16px rgba(74, 144, 226, 0.35); -- 2.49.1 From 12a9a32a7f8480d90b7880456508ea5aae1f8f33 Mon Sep 17 00:00:00 2001 From: Nicolas Murua Date: Wed, 13 May 2026 20:53:25 -0300 Subject: [PATCH 6/9] ejercicio 5 --- ejercicios-clase-8.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 3ee0dcb..13c9599 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -29,4 +29,37 @@ function destacarImportantes() { p.classList.add("destacado"); } } +} + +function agregarComidasLitoral() { + + const contenedor = document.createElement("div"); + + const titulo = document.createElement("h2"); + titulo.textContent = "Comidas típicas del litoral"; + + const parrafo = document.createElement("p"); + parrafo.textContent = "Comidas tradicionales de la región"; + + const lista = document.createElement("ul"); + + const comidas = [ + "Chipá", + "Surubí", + "Pacú", + "Empanadas de pescado", + "Mbejú" + ]; + + for (const comida of comidas) { + const item = document.createElement("li"); + item.textContent = comida; + lista.appendChild(item); + } + + contenedor.appendChild(titulo); + contenedor.appendChild(parrafo); + contenedor.appendChild(lista); + + document.body.appendChild(contenedor); } \ No newline at end of file -- 2.49.1 From f73326402a14e226e8cb2969ba86130c3f73b535 Mon Sep 17 00:00:00 2001 From: Nicolas Murua Date: Wed, 13 May 2026 20:58:09 -0300 Subject: [PATCH 7/9] ejercicio 6 --- ejercicios-clase-8.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 13c9599..3a809a7 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -62,4 +62,13 @@ function agregarComidasLitoral() { contenedor.appendChild(lista); document.body.appendChild(contenedor); +} + +function limpiarLista(idLista){ + + const items = document.querySelectorAll(`#${idLista} li`); + + for (const item of items){ + item.remove(); + } } \ No newline at end of file -- 2.49.1 From 960bf48a5943ca0af44c73550e44255d6dec69ec Mon Sep 17 00:00:00 2001 From: Nicolas Murua Date: Wed, 13 May 2026 21:04:07 -0300 Subject: [PATCH 8/9] ejercicio 6 --- ejercicios-clase-8.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 3a809a7..aa66974 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -71,4 +71,10 @@ function limpiarLista(idLista){ for (const item of items){ item.remove(); } +} + +function cambiarFoto(foto, texto){ + const imagen = document.querySelector("#foto"); + imagen.setAttribute("src", foto); + imagen.setAttribute("alt", texto); } \ No newline at end of file -- 2.49.1 From 3b0d27b79f909806d265f21ef28007fab15d3cf4 Mon Sep 17 00:00:00 2001 From: Nicolas Murua Date: Wed, 13 May 2026 21:08:34 -0300 Subject: [PATCH 9/9] ejercicio 8 --- ejercicios-clase-8.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index aa66974..ee6fb1c 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -77,4 +77,29 @@ function cambiarFoto(foto, texto){ const imagen = document.querySelector("#foto"); imagen.setAttribute("src", foto); imagen.setAttribute("alt", texto); +} + +function construirLista(items){ + + const contenedor = document.createElement("div"); + + const titulo = document.createElement("h2"); + titulo.textContent = "Lista dinámica"; + + const lista = document.createElement("ul"); + + for (const item of items){ + + const li = document.createElement("li"); + + li.textContent = item; + + lista.appendChild(li); + } + + contenedor.appendChild(titulo); + contenedor.appendChild(lista); + document.body.appendChild(contenedor); + contenedor.classList.add("grupo-comidas"); + return contenedor; } \ No newline at end of file -- 2.49.1