Answers for "only allow numbers in text input in js"

1

only allow numbers in text input in js

$(document).ready(function() {
  $("#myTextBox").inputFilter(function(value) {
    return /^\d*$/.test(value);    // Allow digits only, using a RegExp
  },"Only digits allowed");
});
Posted by: Guest on May-03-2022

Code answers related to "only allow numbers in text input in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language