diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 71d2a84..fbdc9e1 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -10,4 +10,13 @@ function agregarLista() { for (const item of items) { item.classList.add("resaltada"); } -} \ No newline at end of file +} + +const lista = document.querySelector("ul"); + + function agregarItem(){ + const nuevoItem = document.createElement("li"); + let itemAgregado = prompt("Ingresa un nuevo item"); + nuevoItem.textContent = itemAgregado; + lista.appendChild(nuevoItem); + } \ No newline at end of file