var optionTexts = [];
$("ul li").each(function() { optionTexts.push($(this).text()) });
…should do the trick. To get the final output you’re looking for, join()
plus some concatenation will do nicely:
var quotedCSV = '"' + optionTexts.join('", "') + '"';