title: How to input phone no in this 'xxx-xxx-xxxx' format in number input field
body: <p>I want that whenever I type a number in the number input field in <code>XXXXXXXXXX</code> format it takes as <code>XXX-XXX-XXXX</code> using HTML, CSS and javascript.</p>
  
  <p>Just like this snippet but without using the mask script.
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('.phone_us').mask('000-000-0000');</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;script src="https://igorescobar.github.io/jQuery-Mask-Plugin/js/jquery.mask.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;!--mask script--&gt;
  
  &lt;input type="text" class="phone_us" /&gt;</code></pre>
  </div>
  </div>
  </p>