A Explanation for what i am doing.
I have ul that have li that has visiting card in it and the amout vary which . i want to add extra li to show the description of the visting card that i clicked. for ex if i clicked 1st 2nd or 3rd card i want to add new li in 4th place if i clicked 4th 5th or 6th then i want to add new li in 7th place.
For this i made an function to split the li in to multidimensional array having three li inside an array. and that mulidimensinal array is call chunks. now i got the write. but i am not able to appened the new li in my required place.
And i am getting this error TypeError: chunks[i] is undefined
And i given the code below
chunks[i] is undefined
chunks = [
[li.pL14, li, li.pR15],
[li.pL14, li, li.pR15],
[li.pL14, li, li.pR15],
[li.pL14, li, li.pR15],
[li.pL14, li, li.pR15]
]
for (var i=0; i<chunks.length; i++) {
for (var j=0; j<chunks[i].length; j++) {
$(chunks[i][j]).click(function() {
$(chunks[i][j]).append('<li class="description"> <div class="cardDesCont mT1Mi"></div></li>');
});
}
}
Why it that happening?
lidefined as?