I'm getting the following error: cannot read property 'innerHTML' of null.
Here is the HTML part:
<div id="itemcost0">300</div>
Now the Javascript part:
itemcount = parseInt(document.getElementById("itemcounter").value);
var loop = 0;
while(loop<=itemcount)
{
itemprice = parseInt(document.getElementById("itemcost" + loop).innerHTML);
loop++;
}
Before anyone suggests this, the javascript is located after the table the div itemcost0 is in. It should also be noted that itemcount has the correct value.
document.getElementById("itemcounter").valuecan you add that part of the html?