From 306801b44971f15647c32cfd04e0558e5e18eb81 Mon Sep 17 00:00:00 2001 From: maximo hidalgo <47135001@gmail.com> Date: Mon, 18 May 2026 19:02:52 -0300 Subject: [PATCH] agregado de filtrado de parrafos importantes --- ejercicios-clase-8.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 7e60d00..5fb0db1 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -22,4 +22,12 @@ nuevoItem.id= "lista-inicial"; lista.appendChild(nuevoItem); console.log("Clase agregada a:", nuevoItem) } -//ejercicio 4 \ No newline at end of file +//ejercicio 4 +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