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