EJ 2 y 3 terminados + arreglo de la hoja de estilos

This commit is contained in:
2026-05-14 22:19:28 -03:00
parent 9c81164673
commit e59c8a8a16
2 changed files with 21 additions and 1 deletions

View File

@@ -3,3 +3,20 @@
const tituloh1 = document.querySelector("h1")
console.log(tituloh1.textContent);
tituloh1.textContent = "Titulo reemplazado correctamente"
//2
function List(){
const items = document.querySelectorAll("ul li")
for (const item of items){
item.classList.add("item-lista")
}
}
//3
function agregarItem(texto){
const nuevoLi = document.createElement("li");
nuevoLi.textContent = texto;
const lista = document.getElementById("lista-inicial");
lista.appendChild(nuevoLi);
}

View File

@@ -100,6 +100,9 @@ h1 {
color: #7a5200;
font-weight: bold;
}
.item-lista{
color:#d7263d;
}
/* =========================
IMAGEN