Adding <span> to alternating comma delimited list in Jquery

ruing

New Member
I'm receiving a comma delimited list of items from a database and placing them in a table cell, and I'd like to add alternating styles, so they are easily differentiated from one another. ie,foo, bar, mon, key, base, ballsuch that the code looks something like this:\[code\]<td class="wide">foo, <span class="alt">bar</span>, mon, <span class="alt">key</span>, base, <span class="alt">ball</span></td>\[/code\]So, I'd like to add a span class to the alternate values.Is there an easy way to do that in jQuery?
 
Top