Why my split
and join
are not working??
$.getJSON(url, function (data) {
// create ".tags" elements and populate them with data
});
$(".tags").text(function (i, val) {
return val.split(",").join(", ");
});
I just simply want to add space after every ',' (comma).