var str = 'Я, ты, он, она'.split(', ').map(function(e){return "<span>"+e+"</span> "}).join(""); alert(str);