title: Allow float on 'input' not only on 'keypress' event
body: <p>i have this code to accept valid <code>int</code> or <code>float</code> numbers.</p>
  
  <pre><code>$("input").on("keypress", function(event) {
         $(this).val($(this).val().replace(/[^0-9\.]/g, ''));
         if ((event.which != 46 || $(this).val().indexOf('.') != -1) &amp;&amp; (event.which &lt; 48 || event.which &gt; 57)) {
           event.preventDefault();
         }
  });
  </code></pre>
  
  <p>however, I was not able to catch user input data by <code>copy-paste</code> and <code>rightclick-paste</code> event.</p>
  
  <p>I tried <code>$("input").on("input",...</code> but not working. Please see fiddle demo below.</p>
  
  <p><a href="https://jsfiddle.net/jcjncyr6/1/" rel="nofollow noreferrer">Fiddle Demo</a></p>