diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index d53afe0..6d70a80 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -2,4 +2,21 @@ //1 const tituloh1 = document.querySelector("h1") console.log(tituloh1.textContent); -tituloh1.textContent = "Titulo reemplazado correctamente" \ No newline at end of file +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); +} + diff --git a/estilo.css b/estilo.css index fcb26fc..07d655d 100644 --- a/estilo.css +++ b/estilo.css @@ -100,6 +100,9 @@ h1 { color: #7a5200; font-weight: bold; } +.item-lista{ + color:#d7263d; +} /* ========================= IMAGEN