jQuery, Replace comma (,) with comma + space (, )

1
2
3
4
5
6
$(window).load(function() {
    $('.selector').each(function() {
        var string = $(this).html();
        $(this).html(string.replace(/,/g , ', '));
    });
});

Leave a Reply

Your email address will not be published. Required fields are marked *

*


2 + = 10

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>