forked from marquez.juan/clase-8-DOM
Agrego ejercicio 3 de la clase 8
This commit is contained in:
@@ -16,4 +16,16 @@ function agregarItemLista() {
|
|||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
item.classList.add("item-lista");
|
item.classList.add("item-lista");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Ejercicio 3 de la clase 8.
|
||||||
|
|
||||||
|
function agregarItem(comidas) {
|
||||||
|
const lista = document.querySelector("#lista-inicial");
|
||||||
|
|
||||||
|
const nuevoItem = document.createElement("li");
|
||||||
|
nuevoItem.textContent = comidas;
|
||||||
|
lista.appendChild(nuevoItem);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user