ejercicio 8
This commit is contained in:
@@ -57,3 +57,18 @@ elemento.remove()
|
|||||||
const imagen = document.querySelector("img")
|
const imagen = document.querySelector("img")
|
||||||
imagen.setAttribute("src", "foto2.jpg");
|
imagen.setAttribute("src", "foto2.jpg");
|
||||||
imagen.setAttribute("alt", "Locro")
|
imagen.setAttribute("alt", "Locro")
|
||||||
|
//ejercicio 8
|
||||||
|
function construirLista(listacomidas) {
|
||||||
|
const seccion = document.createElement("div")
|
||||||
|
const titulo = document.createElement("h2")
|
||||||
|
titulo.textContent = "comidas típicas de la región del litoral"
|
||||||
|
const lista = document.createElement("ul");
|
||||||
|
for (const comida of listacomidas){
|
||||||
|
const elemento = document.createElement("li")
|
||||||
|
elemento.textContent = comida
|
||||||
|
lista.appendChild(elemento)
|
||||||
|
}
|
||||||
|
seccion.appendChild(titulo)
|
||||||
|
seccion.appendChild(lista)
|
||||||
|
return seccion
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user