If I have a list like the following:
Bob Frank
var items = []; $('ul.nameList').children().each(function() { var $this = $(this); var item = { id: $this.attr('value'), title: $this.html() }; items.push(item); });