8 Commits

Author SHA1 Message Date
e1dcf6db72 ejercicio 8 2026-05-25 21:07:50 -03:00
1bb1058df3 Ejercicio 7 2026-05-25 20:10:28 -03:00
5d16d192e1 Ejercicio 6, demore mucho con llamar la class en vez del id 2026-05-25 17:13:53 -03:00
8da25b5006 Ejercicio 5 2026-05-25 15:39:59 -03:00
0f5e6cd31d ejercicio 4 2026-05-25 15:11:20 -03:00
18c88a99b0 Ejercicio 3 resuelto 2026-05-25 14:19:02 -03:00
2165677d15 Ejercicio 2 2026-05-21 23:06:11 -03:00
a498a56751 Ejercicio 1 2026-05-21 22:33:31 -03:00

View File

@@ -1 +1,118 @@
// Vincular este archivo al archivo index.html, y resolver aquí los ejercicios. // 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
function limpiarLista(idDeLaLista){
const lista2 = document.querySelectorAll(`#${idDeLaLista} li`);
for (const lista of lista2) {
lista.remove();
}
}
//ejercicio 7
const imagen = document.querySelector("img");
imagen.setAttribute("src", "foto2.jpg");
imagen.setAttribute("alt", "Locro");
//ejercicio 8
const construirLista1 = (["Comidas mendocinas", "Sopaipilla", "Vino tinto"]);
function construirLista(){
const listaComidaMendoza = Array.from(construirLista1).filter(palabra => palabra.length)
if(listaComidaMendoza.length > 0){
const div1 = document.createElement("div");
div1.classList.add("grupo-comidas");
const miH2 = document.createElement("h2");
miH2.textContent = listaComidaMendoza[0];
div1.appendChild(miH2);
const agregarUl = document.createElement("ul");
agregarUl.classList.add("Comidas-mendocinas");
const agregarLi = document.createElement("li");
agregarLi.textContent = listaComidaMendoza[1];
agregarUl.appendChild(agregarLi);
const agregarLi2 = document.createElement("li");
agregarLi2.textContent = listaComidaMendoza[2];
agregarUl.appendChild(agregarLi2);
div1.appendChild(agregarUl);
document.body.appendChild(div1);
}
}