Skip to content Skip to sidebar Skip to footer

How To Split String Containing Comma Using Span Tag

There is a string containing tags separated by comma:
Dog, Cat, Bird, Pig
).html($('.tags').html().split(', ').map(function(el) {return '<span>' + el + '</span>'}))

Fiddle here


Post a Comment for "How To Split String Containing Comma Using Span Tag"