I am in the process of streamlining my code due to repetitive sections. I anticipate needing to utilize this particular example numerous times. My goal is to implement a for loop, but I'm encountering difficulty with increasing my variable. Currently, while my variable is incrementing, I'm struggling to incorporate my cell data into it. It seems like there may be an issue with double assigning the variable h. I'm seeking advice on how to resolve this challenge. Thank you in advance for your assistance.
For Loop
for (var j = 2; j<15; j++) {
eval("var polebrea" +j);
var h = ("polebrea" +j);
}
h = document.getElementById("part1Table").rows[10].cells[2].innerHTML;
Attempting To Implement Code
polebrea2 = document.getElementById("part1Table").rows[10].cells[2].innerHTML;
polebrea3 = document.getElementById("part1Table").rows[10].cells[3].innerHTML;
polebrea4 = document.getElementById("part1Table").rows[10].cells[4].innerHTML;
polebrea5 = document.getElementById("part1Table").rows[10].cells[5].innerHTML;
(continued until reaching 15)
Inserting Variable
<script>document.write(polebrea2)</script>