I have an array of elements, for an easier example, lets just use some numbers:
var items = new Array('1','2','3','4','5','6','7','8','9','10');
From this array, i want to create 4 unordered list, so every list has 3 items in it, like this:
<ul>
<li>0</li>
<li>1</li>
<li>2</li>
</ul>
<ul>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
...
This is what i got so far, but i'm stuck here, i don't know how to proceed:
var ul = $('<ul>',{'class':'test'});
$.each(items,function(index,value){
if(index%3) {
//...
}
var li = $('<li>').append(value);
ul.append(li);
});