Clase 8 ejercicio DOM #8

Open
maderademarco.sergio wants to merge 9 commits from maderademarco.sergio/clase-8-DOM:ejercicio-8 into main
Showing only changes of commit 130e464ae5 - Show all commits

View File

@@ -16,4 +16,15 @@ function destacarComidas() {
for (const comida of comidas) {
comida.style.color = "red";
}
}
// 3
function agregarItem(texto) {
const lista = document.querySelector("#lista-inicial");
const nuevoItem = document.createElement("li");
nuevoItem.textContent = texto;
lista.appendChild(nuevoItem);
}