Hi ahmadsubuhanl...,
Refer below code.
HTML
<input name="txtAmount" type="text" id="txtAmount" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$('[id*=txtAmount]').keyup(function (event) {
// skip for arrow keys
if (event.which >= 37 && event.which <= 40) { return };
// format number
var str = parseFloat($(this).val().replace(/\D/g, "")).toLocaleString('de-DE');
var pos = str.lastIndexOf('.');
if (pos == -1) {
$(this).val(str);
} else {
str = str.substring(0, pos) + "," + str.substring(pos + 1);
$(this).val(str);
}
if ($(this).val() == "NaN") {
$(this).val("");
}
});
});
</script>
Demo