Using variables instead of $(#test).html
I have code where I want to take this:
- $('#haveImg0').html(haveArray[x]);
and use a variable instead so I can just loop through a for loop.
The full code is
-
for (var x=0; x<(haveArray.length); x++)
{
$('#haveImg'+x;).html(haveArray[x]);
}
But this doesn't work. Is there anyway to do this instead of having to individually type out all the different divs?
Thank you in advance!!!!