forked from marquez.juan/clase-8-DOM
agregado funcion agregarItem
This commit is contained in:
@@ -13,3 +13,13 @@ for (const p of item) {
|
||||
}
|
||||
}
|
||||
//ejercicio 3
|
||||
function agregarItem(texto){
|
||||
const lista = document.querySelector("ul");
|
||||
|
||||
const nuevoItem = document.createElement("li");
|
||||
nuevoItem.textContent = texto ;
|
||||
nuevoItem.id= "lista-inicial";
|
||||
lista.appendChild(nuevoItem);
|
||||
console.log("Clase agregada a:", nuevoItem)
|
||||
}
|
||||
//ejercicio 4
|
||||
Reference in New Issue
Block a user