From 353406174d032aa75952cb14ecac7186b0227074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Blas=20Alarc=C3=B3n?= <47840816@terciariourquiza.edu.ar> Date: Mon, 18 May 2026 18:34:48 -0300 Subject: [PATCH] Cree una funcion para que agregue la clase item-lista a los items de la lista --- ejercicios-clase-8.js | 8 ++++++++ estilo.css | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 11873ab..0407aa0 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -2,4 +2,12 @@ function cambiarTitulo() { const titulo = document.querySelector("h1"); titulo.textContent = "Agua"; +} + +function agregarClaseItems() { + const items = document.querySelectorAll("li"); + + for (const item of items) { + item.classList.add("item-lista"); + } } \ No newline at end of file diff --git a/estilo.css b/estilo.css index fcb26fc..35d4dbf 100644 --- a/estilo.css +++ b/estilo.css @@ -101,6 +101,12 @@ h1 { font-weight: bold; } +.item-lista { + color: red; + font-weight: bold; + background-color: yellow; +} + /* ========================= IMAGEN ========================= */