Generation

generate functionSun, 07 May 2023

Un ciclo que permita mostrar el nombre de un archivo en el botón

for (var i = 0; i < 4; i++) { var div = document.createElement("div"); div.className = "cuadro"; var boton = document.createElement("input"); boton.type = "button"; boton.value = i; //nombre del archivo boton.className = "boton"; div.appendChild(boton); document.getElementById("contenedor").appendChild(div); }

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant