forked from marquez.juan/clase-8-DOM
ejercicio 5: crear seccion dinamica del litoral
This commit is contained in:
@@ -39,3 +39,60 @@ function destacarParrafos() {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Ejercicio 5
|
||||
|
||||
function agregarComidasLitoral() {
|
||||
const div = document.createElement("div");
|
||||
|
||||
const titulo = document.createElement("h2");
|
||||
titulo.textContent = "Comidas típicas del litoral";
|
||||
|
||||
const parrafo = document.createElement("p");
|
||||
parrafo.textContent = "Algunas comidas tradicionales del litoral argentino.";
|
||||
|
||||
const lista = document.createElement("ul");
|
||||
|
||||
const comidas = ["Chipá", "Surubí", "Pacú"];
|
||||
|
||||
for (const comida of comidas) {
|
||||
const item = document.createElement("li");
|
||||
|
||||
item.textContent = comida;
|
||||
|
||||
lista.appendChild(item);
|
||||
}
|
||||
|
||||
div.appendChild(titulo);
|
||||
div.appendChild(parrafo);
|
||||
div.appendChild(lista);
|
||||
|
||||
document.body.appendChild(div);
|
||||
}// Ejercicio 5
|
||||
|
||||
function agregarComidasLitoral() {
|
||||
const div = document.createElement("div");
|
||||
|
||||
const titulo = document.createElement("h2");
|
||||
titulo.textContent = "Comidas típicas del litoral";
|
||||
|
||||
const parrafo = document.createElement("p");
|
||||
parrafo.textContent = "Algunas comidas tradicionales del litoral argentino.";
|
||||
|
||||
const lista = document.createElement("ul");
|
||||
|
||||
const comidas = ["Chipá", "Surubí", "Pacú"];
|
||||
|
||||
for (const comida of comidas) {
|
||||
const item = document.createElement("li");
|
||||
|
||||
item.textContent = comida;
|
||||
|
||||
lista.appendChild(item);
|
||||
}
|
||||
|
||||
div.appendChild(titulo);
|
||||
div.appendChild(parrafo);
|
||||
div.appendChild(lista);
|
||||
|
||||
document.body.appendChild(div);
|
||||
}
|
||||
Reference in New Issue
Block a user