HTML CSS Javascript jQuery AJAX PHP Java MORE

Add number format in input box Javascript

Some time we need to enter number format for amount. So in this example I am explaining how to Add number format in input box Javascript.

<!DOCTYPE html>
<title>Page Title</title>

    <input type="text" id="Amount" value="" />
            var Amount = document.getElementById("Amount");
            Amount.addEventListener('keyup', function(evt){
                var n = parseInt(this.value.replace(/\D/g,''),10);
                Amount.value = n.toLocaleString();
            }, false);