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>
<html>
<head>
<title>Page Title</title>
</head>
    <body>

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