From 86c01badae575015183144b2f061f6c900216149 Mon Sep 17 00:00:00 2001 From: Gonzalo <43428577@terciariourquiza.edu.ar> Date: Sat, 23 May 2026 13:37:02 -0300 Subject: [PATCH] Ejercicio 5 --- ejercicios-clase-8.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 6cc1917..58fd8e7 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -25,4 +25,44 @@ function agregarItem(texto) { nuevoItem.textContent = texto; lista.appendChild(nuevoItem); +} + +//Ejercicio 4 +function destacarParrafos() { + const parrafos = document.querySelectorAll("#parrafos p"); + + for (const parrafo of parrafos) { + if (parrafo.textContent.includes("importante")) { + parrafo.classList.add("destacado"); + } + } +} + +//Ejercicio 5 +function agregarComidasLitoral() { + const div = document.createElement("div"); + + const titulo = document.createElement("h2"); + titulo.textContent = "Comidas típicas del litoral"; + + const parrafo = document.createElement("p"); + parrafo.textContent = "Algunas comidas tradicionales de la región."; + + const lista = document.createElement("ul"); + + const comidas = ["Chipá", "Pacú", "Mbejú"]; + + for (const comida of comidas) { + const item = document.createElement("li"); + + item.textContent = comida; + + lista.appendChild(item); + } + + div.appendChild(titulo); + div.appendChild(parrafo); + div.appendChild(lista); + + document.body.appendChild(div); } \ No newline at end of file