I need to call a function in a loop.
I have the following code....
do {
var name = prompt("Enter name:");
if (!isNaN(age) && name != null && name != "") {
names[i] = name;
}
loop = confirm("Add new name?");
i++;
// at this place I want to call the function
// addnew(document.getElementById("newtable")"; so when someone clicks cancel in the confirm box the javascript creates a dynamic table from the array names
} while (loop);
Anyone knows how I can call the function addnew?