forked from marquez.juan/clase-8-DOM
Cree una funcion que agrega un div, un h2, un parrafo introductorio y un ul con comidas del litoral
This commit is contained in:
@@ -30,3 +30,34 @@ for (const p of parrafos) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function agregarDiv() {
|
||||
const nuevoDiv = document.createElement("div");
|
||||
|
||||
const nuevoh2 = document.createElement("h2");
|
||||
nuevoh2.textContent = "Comidas tipicas de la region del litoral";
|
||||
|
||||
const pintroductorio = document.createElement("p");
|
||||
pintroductorio.textContent = "Estas son algunas comidas tradicionales de la región del litoral argentino.";
|
||||
|
||||
const nuevoul = document.createElement("ul");
|
||||
|
||||
const comida1 = document.createElement("li");
|
||||
comida1.textContent = "Chipa";
|
||||
|
||||
const comida2 = document.createElement("li");
|
||||
comida2.textContent = "Pescado";
|
||||
|
||||
const comida3 = document.createElement("li");
|
||||
comida3.textContent = "Sopa paraguaya";
|
||||
|
||||
nuevoul.appendChild(comida1);
|
||||
nuevoul.appendChild(comida2);
|
||||
nuevoul.appendChild(comida3);
|
||||
|
||||
nuevoDiv.appendChild(nuevoh2);
|
||||
nuevoDiv.appendChild(pintroductorio);
|
||||
nuevoDiv.appendChild(nuevoul);
|
||||
|
||||
document.body.appendChild(nuevoDiv);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user