I have severals divs and an array. I insert each of the divs (id) in the aray with a function. If I apply that function to new divs, the array will start with index value 0, intead of keeping the last index value.
Here is a fiddle: http://jsfiddle.net/nQWfG/
assign('.firstround');
Assigns index values of 0, 1, 2.
assign('.secondround');
Assigns index values of 0, 1, 2 again, and I want them to be 3, 4, 5.
EDIT
The reason I am doing this two times is because $(‘.secondround’) divs will be loaded time later via ajax.
Just define a global index: http://jsfiddle.net/nQWfG/2/