updating a variable onclick
this function is called here:
function AddToIngList (form)
var Ingredient = form.ingredienttoadd.value;
form.ingredients_added.value += Ingredient + "\n";
var objHTML, objText, objinput;
objHTML = document.createElement('P');
var strTest = form.ingredienttoadd.value;
objText = document.createTextNode(strTest);
objinput = document.createElement
objinput.name = "input"
objinput.value = "";
which is a submit button (generated by php for reasons i wont go into here)
echo"<input type=\"button\" name=\"button\" Value=\"add\" onClick=\"AddToIngList(this.form)\">";
so basically everytime someone clicks "button" a new input box is created with the name "input". obviously i want each box to have a unique name which is where my problem lies. is there a way that i can call the newly created input box "input1" and then on the next click, since input1 already exists call it "input2"?
can anyone help?