title: How to remove digits after decimal using JavaScript?
body: <p>I am using numeric in an HTML web page. The problem is that I want numbers without decimals.</p>
  
  <p><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>function copyText() {
    var mynumber = document.getElementById("field1").value;
    alert(mynumber);
    var mytest = parseInt(mynumber);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Field1: &lt;input type="number" id="field1" value="123.124" /&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;button onclick="copyText()"&gt;Check Number&lt;/button&gt;
  
  &lt;p&gt;A function is triggered when the button is clicked. The function copies the text in Field1 to Field2.&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>