title: how to format input box text as I am typing it
body: <p>How do I format the number as I type it in the html input box?</p>
  
  <p>so for example, I want to type the number 2000, the moment I type the 4th digit, the text (that's currently displayed in the textbox) will be automatically formatted to 2,000 (with a comma).</p>
  
  <pre><code>//my modified code based on Moob answer below
  
  &lt;input type="text" class="formattedNumberField" onkeyup="myFunc()"&gt;
  
  //jQuery
  $(".formattedNumberField").on('keyup', function(){
      var n = parseInt($(this).val().replace(/\D/g,''),10);
      $(this).val(n.toLocaleString());
  });
  
  function myFunc(){
  // doing something else
  }
  </code></pre>
  
  <p>while this code works perfect as shown in Moob Fiddle, its not working on my end maybe because I have another onkeyup event inside the inputbox???</p>