main #15
@@ -71,4 +71,20 @@ const cambiarImg = () => {
|
||||
img.alt = "Locro";
|
||||
}
|
||||
|
||||
// Ejercicio 8
|
||||
const construirlist = (array) => {
|
||||
const div = document.createElement("div");
|
||||
div.classList.add("grupo-comidas");
|
||||
const h2 = document.createElement("h2");
|
||||
h2.textContent = array[0];
|
||||
const ul = document.createElement("ul");
|
||||
for (let i = 1; i < array.length; i++){
|
||||
const li = document.createElement("li");
|
||||
li.textContent = array[i];
|
||||
ul.appendChild(li);
|
||||
};
|
||||
div.appendChild(ul);
|
||||
return div;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user