Cree una funcion para que agregue la clase item-lista a los items de la lista

This commit is contained in:
2026-05-18 18:34:48 -03:00
parent b3d7e12d24
commit 353406174d
2 changed files with 14 additions and 0 deletions

View File

@@ -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");
}
}

View File

@@ -101,6 +101,12 @@ h1 {
font-weight: bold;
}
.item-lista {
color: red;
font-weight: bold;
background-color: yellow;
}
/* =========================
IMAGEN
========================= */