9 Commits

Author SHA1 Message Date
Nicolas Murua
3b0d27b79f ejercicio 8 2026-05-13 21:08:34 -03:00
Nicolas Murua
960bf48a59 ejercicio 6 2026-05-13 21:04:07 -03:00
Nicolas Murua
f73326402a ejercicio 6 2026-05-13 20:58:09 -03:00
Nicolas Murua
12a9a32a7f ejercicio 5 2026-05-13 20:53:25 -03:00
Nicolas Murua
2a0aa2bbc2 ejercicio 4 2026-05-13 20:42:15 -03:00
Nicolas Murua
b92b2428a7 ejercicio 3 2026-05-13 20:36:00 -03:00
Nicolas Murua
d6199a07ea correccion de la funcion del ejercicio 2 2026-05-13 20:29:05 -03:00
Nicolas Murua
67173a3a9f ejercicio 2 2026-05-13 20:26:24 -03:00
Nicolas Murua
ccab67b2b7 ejercicio 1 2026-05-13 20:11:36 -03:00
3 changed files with 107 additions and 1 deletions

View File

@@ -1 +1,105 @@
// Vincular este archivo al archivo index.html, y resolver aquí los ejercicios.
function cambiarText(texto){
const textoH1 = document.querySelector("h1");
textoH1.textContent = texto;
}
function agregarClase(){
const listaComida = document.querySelectorAll(".item-comida");
for (const i of listaComida){
i.classList.add("item-lista");
}
}
function agregarItem(texto){
const lista = document.querySelector("#lista-inicial");
const nuevo = document.createElement("li");
nuevo.textContent = texto;
lista.appendChild(nuevo);
}
function destacarImportantes() {
const parrafos = document.querySelectorAll("#parrafos p");
for (const p of parrafos) {
if (p.textContent.includes("importante")) {
p.classList.add("destacado");
}
}
}
function agregarComidasLitoral() {
const contenedor = document.createElement("div");
const titulo = document.createElement("h2");
titulo.textContent = "Comidas típicas del litoral";
const parrafo = document.createElement("p");
parrafo.textContent = "Comidas tradicionales de la región";
const lista = document.createElement("ul");
const comidas = [
"Chipá",
"Surubí",
"Pacú",
"Empanadas de pescado",
"Mbejú"
];
for (const comida of comidas) {
const item = document.createElement("li");
item.textContent = comida;
lista.appendChild(item);
}
contenedor.appendChild(titulo);
contenedor.appendChild(parrafo);
contenedor.appendChild(lista);
document.body.appendChild(contenedor);
}
function limpiarLista(idLista){
const items = document.querySelectorAll(`#${idLista} li`);
for (const item of items){
item.remove();
}
}
function cambiarFoto(foto, texto){
const imagen = document.querySelector("#foto");
imagen.setAttribute("src", foto);
imagen.setAttribute("alt", texto);
}
function construirLista(items){
const contenedor = document.createElement("div");
const titulo = document.createElement("h2");
titulo.textContent = "Lista dinámica";
const lista = document.createElement("ul");
for (const item of items){
const li = document.createElement("li");
li.textContent = item;
lista.appendChild(li);
}
contenedor.appendChild(titulo);
contenedor.appendChild(lista);
document.body.appendChild(contenedor);
contenedor.classList.add("grupo-comidas");
return contenedor;
}

View File

@@ -101,6 +101,7 @@ h1 {
font-weight: bold;
}
/* =========================
IMAGEN
========================= */
@@ -143,7 +144,7 @@ h1 {
.destacado {
background: linear-gradient(135deg, #4a90e2, #357abd);
color: white;
color: rgb(255, 255, 255);
font-weight: bold;
padding: 18px !important;
box-shadow: 0 6px 16px rgba(74, 144, 226, 0.35);

View File

@@ -31,5 +31,6 @@
<p>¿Y este párrafo? ¿Será importante?</p>
<p>Este es otro párrafo del montón.</p>
</div>
<script src="ejercicios-clase-8.js"></script>
</body>
</html>