bobbybrown69
Programmer
How can I clean this up (possibly using an array) that would take into effect all instances of l != 2 - 12
i.e. If l != 6 then oNewTd6 - oNewTd12 should = document.createElement("");
i.e. If l != 9 then oNewTd9 - oNewTd12 should = document.createElement("");
New to javascript and not sure how to clean this up and make it work.
-----------------------------------
if (l != 2){
oNewTd2 = document.createElement("");
}
if (l != 3){
oNewTd3 = document.createElement("");
}
if (l != 4){
oNewTd4 = document.createElement("");
}
if (l != 5){
oNewTd5 = document.createElement("");
}
if (l != 6){
oNewTd6 = document.createElement("");
}
if (l != 7){
oNewTd7 = document.createElement("");
}
if (l != 8){
oNewTd8 = document.createElement("");
}
if (l != 9){
oNewTd9 = document.createElement("");
}
if (l != 10){
oNewTd10 = document.createElement("");
}
if (l != 11){
oNewTd11 = document.createElement("");
}
if (l != 12){
oNewTd12 = document.createElement("");
}
i.e. If l != 6 then oNewTd6 - oNewTd12 should = document.createElement("");
i.e. If l != 9 then oNewTd9 - oNewTd12 should = document.createElement("");
New to javascript and not sure how to clean this up and make it work.
-----------------------------------
if (l != 2){
oNewTd2 = document.createElement("");
}
if (l != 3){
oNewTd3 = document.createElement("");
}
if (l != 4){
oNewTd4 = document.createElement("");
}
if (l != 5){
oNewTd5 = document.createElement("");
}
if (l != 6){
oNewTd6 = document.createElement("");
}
if (l != 7){
oNewTd7 = document.createElement("");
}
if (l != 8){
oNewTd8 = document.createElement("");
}
if (l != 9){
oNewTd9 = document.createElement("");
}
if (l != 10){
oNewTd10 = document.createElement("");
}
if (l != 11){
oNewTd11 = document.createElement("");
}
if (l != 12){
oNewTd12 = document.createElement("");
}