Answers for "allow only numbers js"

1

js get numbers only

var str = "Rs. 6,67,000";
    var res = str.replace(/\D/g, "");
    alert(res); // 667000
Posted by: Guest on March-23-2021
0

javascript allow only numeric characters

$('#MyTextInput').on('propertychange input', function () {
  let result = $(this).val().replace(/[^\d]+/g, '');
  $(this).val(result);
});
Posted by: Guest on June-24-2021

Code answers related to "allow only numbers js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language