From b612de3f16a62817632c7175484e0349c663bbf6 Mon Sep 17 00:00:00 2001 From: Bruno Date: Thu, 14 May 2026 22:30:48 -0300 Subject: [PATCH] Resolucion del 2do ejercicio --- ejercicios-clase-8.js | 8 +++++++- estilo.css | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index a40d93a..5009444 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -9,4 +9,10 @@ const item = document.querySelectorAll("ul li"); for (const i of item) { console.log(i.textContent); } -item.classList.push("item-lista"); \ No newline at end of file + +function agregarItem() { + const item = document.querySelectorAll("ul li"); + for (const i of item) { + i.classList.add("item-lista"); + } +} diff --git a/estilo.css b/estilo.css index fcb26fc..c4f3fd7 100644 --- a/estilo.css +++ b/estilo.css @@ -176,3 +176,7 @@ h1 { padding: 20px; } } + +.item-lista { + color: red; +} \ No newline at end of file