From 215bc5e6d21ed85b0c17192eddcf1366410f367a Mon Sep 17 00:00:00 2001 From: Facundo Saucedo <43495919@terciariourquiza.edu.ar> Date: Thu, 14 May 2026 14:09:04 -0300 Subject: [PATCH] feat: add addItem function to append new items to the list --- ejercicios-clase-8.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 978f76c..037e981 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -14,4 +14,13 @@ const addClass = (a) => { list.forEach((item) => { item.classList.add(a); }); +} + +// Ejercicio 3 + +const addItem = (a) => { + const list = document.querySelector('ul'); + const newItem = document.createElement('li'); + newItem.textContent = a; + list.appendChild(newItem); } \ No newline at end of file