I'm trying to add multiple Objects and later to display them all. How would I do this? Every method I googled just uses For-In/For and iterate through characters and I only see the last added object...
for(var i = 0; i < forms.length; i++)
{
alert(forms[i].id + " " + 10 + " " + forms[i].value);
var aObj = new A(forms[i].id, 10, forms[i].value);
var obj = JSON.stringify(aObj);
}
var str = "";
for(var i = 0; i < jObj.length; i++)
{
str += jObj[i];
}
alert(str);
Only solution I can come up is to create an array and store them all there?
obj[i]in your code above, just declare obj as an Array outside the first loop).