I've been trying to create list of months where id of every months has id written from months_id...
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
var months_id = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]
var cells = "";
for (i = 0; i <= 11; i++) {
cells += "<div id='" + months_id + "'>" + months[i] + "</div>";
}
document.getElementsByClassName("divMonths")[0].innerHTML = cells;
I've tried for (i = 0 && months_id = 0; i <= 11 && months_id <= 0; i++ && months_id++)
and for (i = 0; i <= 11; i++) {
for (months_id = 0; months_id <= 11; months_id++) {//...}
}
but both methods didn't work.
Is there any way how to write it correctly?