From abe82db60bd6f96958cc7974a14a5d727bdcf603 Mon Sep 17 00:00:00 2001 From: Facundo Saucedo <43495919@terciariourquiza.edu.ar> Date: Thu, 14 May 2026 14:22:19 -0300 Subject: [PATCH] feat: add highlight function to emphasize important paragraphs --- ejercicios-clase-8.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 037e981..c7f82d0 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -23,4 +23,15 @@ const addItem = (a) => { const newItem = document.createElement('li'); newItem.textContent = a; list.appendChild(newItem); +} + +// Ejercicio 4 + +const highlight = () => { + const paragraphs = document.querySelectorAll('#parrafos p'); + paragraphs.forEach((p) => { + if (p.textContent.toLowerCase().includes('importante')) { + p.classList.add('destacado'); + } + }); } \ No newline at end of file