// Vincular este archivo al archivo index.html, y resolver aquí los ejercicios. // ejercicio 1 console.log("El archivo esta vinculado correctamente.") const parrafo = document.querySelector("h1"); console.log(parrafo.textContent); parrafo.textContent = "Hola a todos!"; /* ejercicio 2 */ function agregarLista() { const items = document.querySelectorAll(".lista-comidas"); for (const item of items) { item.classList.add("resaltada"); } } /* ejercicio 3 */ 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); } //ejercicio 4 const contenedor = document.getElementById("parrafos"); if(contenedor){ const oracion = contenedor.querySelectorAll("p"); const parrafosImportantes = Array.from(oracion).filter(palabra => palabra.textContent.toLowerCase().includes("importante")); parrafosImportantes.forEach(parrafo => { parrafo.classList.add("destacado"); }); } //ejercicio 5 function comidaLitoral(){ const nuevoDiv = document.querySelector("div"); const nuevoH2 = document.createElement("h2"); nuevoH2.textContent = "Comidas del Litoral argentino: "; nuevoDiv.appendChild(nuevoH2); const nuevoUl = document.createElement("ul"); nuevoH2.appendChild(nuevoUl); const nuevoLi = document.createElement("li"); nuevoLi.textContent = "Chupin de pescado"; nuevoUl.appendChild(nuevoLi); const nuevoLi2 = document.createElement("li"); nuevoLi2.textContent = "Guiso Carrero"; nuevoUl.appendChild(nuevoLi2); const nuevoLi3 = document.createElement("li"); nuevoLi3.textContent = "Mbeyú" nuevoUl.appendChild(nuevoLi3); const nuevoLi4 = document.createElement("li"); nuevoLi4.textContent = "Pescado a la parrilla" nuevoUl.appendChild(nuevoLi4); } //ejercicio 6