Clase 8 ejercicio DOM #8
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user