Cree una funcion para poder agregar text a una lista
This commit is contained in:
@@ -13,3 +13,11 @@ const addClass = (className) => {
|
|||||||
item.classList.add(className);
|
item.classList.add(className);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ejercicio 3
|
||||||
|
const agregarItem = (text) =>{
|
||||||
|
const list = document.querySelector("#lista-inicial");
|
||||||
|
const newLi = document.createElement("li");
|
||||||
|
newLi.textContent = text;
|
||||||
|
list.appendChild(newLi);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user