forked from marquez.juan/clase-8-DOM
Cree una funcion llamada agregaritem para que cree un li y lo agregue al final de la lista con un id especifico
This commit is contained in:
@@ -10,4 +10,13 @@ function agregarClaseItems() {
|
||||
for (const item of items) {
|
||||
item.classList.add("item-lista");
|
||||
}
|
||||
}
|
||||
|
||||
function agregarItem(texto) {
|
||||
const lista = document.querySelector("#lista-inicial");
|
||||
|
||||
const nuevaLista = document.createElement("li");
|
||||
nuevaLista.textContent = texto;
|
||||
|
||||
lista.appendChild(nuevaLista);
|
||||
}
|
||||
Reference in New Issue
Block a user