javascript allow only numeric characters

Solutions on MaxInterview for javascript allow only numeric characters by the best coders in the world

showing results for - "javascript allow only numeric characters"
Teo
22 Nov 2020
1$('#MyTextInput').on('propertychange input', function () {
2  let result = $(this).val().replace(/[^\d]+/g, '');
3  $(this).val(result);
4});