$(document).on("keyup", "input:text[comma]", function () {

        $(this).val($(this).val().toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));

});

+ Recent posts