If I have a list like the following:
<ul class="nameList">
<li value="1">Bob</li>
<li value="2">Frank</li>
<li value="3">Sally</li>
</ul>
How can I convert that into a json object like so:
[{"id":"1","title":"Bob"}, {"id":"2","title":"Frank"}, {"id":"3","title":"Frank"}]
I need to get that data into that format so I can then pass pass it in a $.post() call back to my php server.
Can someone tell me how to get the items from that list and convert them into the above json using jQuery?