I have an html list something like this:
red yellow blue <
red yellow blue
You can use jQuery.map()
Live Demo
texts = $('li').map(function(){ return $(this).text(); }).get().join(',');