$(', ') considered as a selector (invalid) because it cannot create node text with a string.
But
$("<span>, </span>").after($(this)); will work due to valid markup.
Try:
$(this).after(', ');
OR
$(this).append(', ');
OR
$(this).text(function(i, oldText) {
return oldText + ', ';
})
source
share