If I have the following DOM elements
content1 content2
how, usi
You can loop over the item divs and add objects to an array.
var items = new Array(); $("div.item").each(function() { var item = {classname: this.className, content: $(this).text()}; items.push(item); });