I want to build a table in javascript using two arrays one for the months and another for the days of each month. I want to show a row with the months and below a row with the days. Start as follows:
<script type="text/javascript">
var meses =["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"];
var dias = [31,28,31,30,31,30,31,31,30,31,30,31];
var result = "";
for (var i = 0; i < meses.length; i++) {
document.write(meses[i]+" ");
for (var j = 0; j < dias.length; j++) {
document.write(dias[j]);
}
}
//document.getElementById("meses").innerHTML = "<td>"+meses[i]+"</td>";
//document.getElementById("dias").innerHTML = "<td>"+dias[j]+"</td>";
</script>
But it does not work for me ... I do not know how to make the two arrays come together to be able to insert them in a table ...