Im strugling with this array:
first id = 1
items for the second id = 12,21,34,33;
second id = 2
items for the second id = 21,12,34
It looks like this in my array :
arr = [12 1,21 1,34 1,33 1,21 2,12 2,34 2]
i want to store it like this:
id | item_id
1 12
1 21
1 34
1 33
2 21
2 12
2 34
here's my code :
var item_id = new Array();
$("td.items").each(function() {
if(this){
item_id.push($(this).attr('id'));
}
});