forked from marquez.juan/clase-8-DOM
ejercicio 3
This commit is contained in:
@@ -11,3 +11,10 @@ for (const item of items) {
|
|||||||
item.style.color = "red"
|
item.style.color = "red"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//ejercicio 3
|
||||||
|
function agregaritem(comida){
|
||||||
|
const lista = document.querySelector("#lista-inicial");
|
||||||
|
const nuevoitem = document.createElement("li")
|
||||||
|
nuevoitem.textContent = comida;
|
||||||
|
lista.appendChild(nuevoitem);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user