clase 8 #11
@@ -74,4 +74,26 @@ function limpiarLista(idLista) {
|
||||
const foto = document.querySelector("#foto");
|
||||
|
||||
foto.src = "foto2.jpg";
|
||||
foto.alt = "Locro";
|
||||
foto.alt = "Locro";
|
||||
|
||||
function construirLista(array) {
|
||||
|
||||
const nuevoDiv2 = document.createElement("div")
|
||||
nuevoDiv2.classList.add("grupo-comidas");
|
||||
|
||||
const titulo2 = document.createElement("h2");
|
||||
titulo2.textContent = array[0];
|
||||
|
||||
const ul2 = document.createElement("ul")
|
||||
|
||||
for (let i = 1; i < array.length; i++) {
|
||||
const li = document.createElement("li");
|
||||
li.textContent = array[i];
|
||||
ul2.appendChild(li);
|
||||
}
|
||||
|
||||
nuevoDiv2.appendChild(titulo2);
|
||||
nuevoDiv2.appendChild(ul2);
|
||||
|
||||
return nuevoDiv2;
|
||||
}
|
||||
Reference in New Issue
Block a user