From 502b762b99d20fdc271c8c46561e1aa5e3d2c6bc Mon Sep 17 00:00:00 2001 From: Facundo Saucedo <43495919@terciariourquiza.edu.ar> Date: Thu, 14 May 2026 14:04:22 -0300 Subject: [PATCH] feat: add addClass function and style for item-lista --- ejercicios-clase-8.js | 9 +++++++++ estilo.css | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 97f5d50..978f76c 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -5,4 +5,13 @@ const changeTittle = (a) => { const tittle = document.querySelector('h1'); tittle.textContent = a; +} + +// Ejercicio 2 + +const addClass = (a) => { + const list = document.querySelectorAll('li'); + list.forEach((item) => { + item.classList.add(a); + }); } \ No newline at end of file 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 ========================= */