I am trying to store some DOM information into an Array so I can use it elsewhere.
This works if I use a Variable, but if I try to use an Array I get “Arrayname is not a function” error message? I’m not sure why this would work in a Variable and not an array.
This is the code I’m running:
function testmove(total) {
for (var x=1; x<=total; x++) {
allstore(x) = jQuery('#block-views-items-block .views-row-1').children('div');
x++;
}
}
This works:
function testmove(total) {
store1 = jQuery('#block-views-items-block .views-row-1').children('div');
}
Am I missing something/doing something wrong here?
If
allStoreis an array, you should be using it like this:allStore[x]