forked from marquez.juan/clase-8-DOM
ejercicio 5
This commit is contained in:
@@ -29,4 +29,37 @@ function destacarImportantes() {
|
|||||||
p.classList.add("destacado");
|
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);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user