Menu
I have a hidden element in HTML that contains a number of times I want a loop to run, based on the number of elements fetched from an SQL query.
I am doing the following code in JavaScript to make the loop run according the the value that is store in this hidden element (optCount).
The loop does not loop at all.
[CODE]var optCount = (document.getElementById(‘optionCount’).value);
// Add the options to the drop down menu
for(i=1; i < (optCount+1); i++)
{
}
What am I doing wrong?
EDIT: It seems to not loop at all, unless the number of loops is above 5, even with a manually entered number.
Thanks,
TK