From ad14f635178d23092dc7827749f936195fb868f9 Mon Sep 17 00:00:00 2001 From: Facundo Saucedo <43495919@terciariourquiza.edu.ar> Date: Thu, 14 May 2026 13:26:11 -0300 Subject: [PATCH 1/8] feat: add changeTittle function for DOM manipulation --- ejercicios-clase-8.js | 7 +++++++ index.html | 1 + 2 files changed, 8 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index af39c43..97f5d50 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -1 +1,8 @@ // Vincular este archivo al archivo index.html, y resolver aquí los ejercicios. + +// Ejercicio 1 + +const changeTittle = (a) => { + const tittle = document.querySelector('h1'); + tittle.textContent = a; +} \ No newline at end of file diff --git a/index.html b/index.html index 0c393ac..dcd25dc 100644 --- a/index.html +++ b/index.html @@ -32,4 +32,5 @@

Este es otro párrafo del montón.

+ -- 2.49.1 From 502b762b99d20fdc271c8c46561e1aa5e3d2c6bc Mon Sep 17 00:00:00 2001 From: Facundo Saucedo <43495919@terciariourquiza.edu.ar> Date: Thu, 14 May 2026 14:04:22 -0300 Subject: [PATCH 2/8] feat: add addClass function and style for item-lista --- ejercicios-clase-8.js | 9 +++++++++ estilo.css | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 97f5d50..978f76c 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -5,4 +5,13 @@ const changeTittle = (a) => { const tittle = document.querySelector('h1'); tittle.textContent = a; +} + +// Ejercicio 2 + +const addClass = (a) => { + const list = document.querySelectorAll('li'); + list.forEach((item) => { + item.classList.add(a); + }); } \ No newline at end of file diff --git a/estilo.css b/estilo.css index fcb26fc..e55df68 100644 --- a/estilo.css +++ b/estilo.css @@ -101,6 +101,14 @@ h1 { font-weight: bold; } +/* Clase item-lista */ +.item-lista { + background: #fff4d6; + border-color: #f4b400; + color: #7a5200; + font-weight: bold; +} + /* ========================= IMAGEN ========================= */ -- 2.49.1 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 3/8] 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 -- 2.49.1 From abe82db60bd6f96958cc7974a14a5d727bdcf603 Mon Sep 17 00:00:00 2001 From: Facundo Saucedo <43495919@terciariourquiza.edu.ar> Date: Thu, 14 May 2026 14:22:19 -0300 Subject: [PATCH 4/8] feat: add highlight function to emphasize important paragraphs --- ejercicios-clase-8.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 037e981..c7f82d0 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -23,4 +23,15 @@ const addItem = (a) => { const newItem = document.createElement('li'); newItem.textContent = a; list.appendChild(newItem); +} + +// Ejercicio 4 + +const highlight = () => { + const paragraphs = document.querySelectorAll('#parrafos p'); + paragraphs.forEach((p) => { + if (p.textContent.toLowerCase().includes('importante')) { + p.classList.add('destacado'); + } + }); } \ No newline at end of file -- 2.49.1 From 981b59b0660c63bf706b81fcb7303eada5419940 Mon Sep 17 00:00:00 2001 From: Facundo Saucedo <43495919@terciariourquiza.edu.ar> Date: Thu, 14 May 2026 14:29:51 -0300 Subject: [PATCH 5/8] feat: add newSection function to create a section with typical dishes from the Litoral --- ejercicios-clase-8.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index c7f82d0..bc885a5 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -34,4 +34,29 @@ const highlight = () => { p.classList.add('destacado'); } }); +} + +// Ejercicio 5 + +const newSection = () => { + const body = document.querySelector('body'); + const div = document.createElement('div'); + body.appendChild(div); + + const h2 = document.createElement('h2'); + h2.textContent = 'Comidas tipidas del Litoral'; + div.appendChild(h2); + + const parragraph = document.createElement('p'); + parragraph.textContent = 'El litoral argentino es conocido por su rica gastronomía, que incluye platos típicos como el surubí a la parrilla, el pacú al horno, la boga frita y el chivito al plato. Estos platos reflejan la diversidad de ingredientes y sabores que se encuentran en la región, y son una parte importante de la cultura culinaria del litoral.'; + div.appendChild(parragraph); + + const list = document.createElement('ul'); + const items = ['Surubí a la parrilla', 'Pacú al horno', 'Boga frita', 'Chivito al plato']; + items.forEach((item) => { + const li = document.createElement('li'); + li.textContent = item; + list.appendChild(li); + }); + div.appendChild(list); } \ No newline at end of file -- 2.49.1 From f80218541e6a0409eece6991e024a8de477e90a8 Mon Sep 17 00:00:00 2001 From: Facundo Saucedo <43495919@terciariourquiza.edu.ar> Date: Thu, 14 May 2026 14:37:01 -0300 Subject: [PATCH 6/8] feat: add cleanList function to delete specified elements from the DOM --- ejercicios-clase-8.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index bc885a5..f16cca3 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -59,4 +59,13 @@ const newSection = () => { list.appendChild(li); }); div.appendChild(list); +} + +// Ejercicio 6 + +const cleanList = (id) => { + const list = document.getElementById(id); + while (list.firstChild) { + list.removeChild(list.firstChild); + } } \ No newline at end of file -- 2.49.1 From eda48c462d6d098283485a20c628863a4e3e5547 Mon Sep 17 00:00:00 2001 From: Facundo Saucedo <43495919@terciariourquiza.edu.ar> Date: Thu, 14 May 2026 14:40:46 -0300 Subject: [PATCH 7/8] feat: add changeImage function to update image source and alt text --- ejercicios-clase-8.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index f16cca3..1f3717f 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -68,4 +68,11 @@ const cleanList = (id) => { while (list.firstChild) { list.removeChild(list.firstChild); } -} \ No newline at end of file +} + +// Ejercicio 7 + +const changeImage = () => { + const image = document.querySelector('img'); + image.src = "foto2.jpg"; + image.alt = 'Locro';} \ No newline at end of file -- 2.49.1 From 16280537034cde61e8803f2eedd300a78b821cbc Mon Sep 17 00:00:00 2001 From: Facundo Saucedo <43495919@terciariourquiza.edu.ar> Date: Thu, 14 May 2026 14:47:54 -0300 Subject: [PATCH 8/8] feat: add buildList function to create a list from an array of items --- ejercicios-clase-8.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 1f3717f..e191e6f 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -75,4 +75,26 @@ const cleanList = (id) => { const changeImage = () => { const image = document.querySelector('img'); image.src = "foto2.jpg"; - image.alt = 'Locro';} \ No newline at end of file + image.alt = 'Locro';} + +// Ejercicio 8 + +const buildList = (arr) => { + const div = document.createElement('div'); + div.classList.add('grupo-comidas'); + + const h2 = document.createElement('h2'); + h2.textContent = arr[0]; + div.appendChild(h2); + + const ul = document.createElement('ul'); + + for (let i = 1; i < arr.length; i++) { + const li = document.createElement('li'); + li.textContent = arr[i]; + ul.appendChild(li); + } + + div.appendChild(ul); + return div; +}; \ No newline at end of file -- 2.49.1