I have an input filed with a class called restrict-numbers which i want to restrict the entered characters to only accept numbers, i used the following code which is great b
This code is for javascript and used in my angular app.
jQuery('#Id').on('paste keyup', function(e){ jQuery(this).val(document.getElementById('Id').value.replace(/[^\d]/g, '')); });
Where Id is input field id and it is blocked alphabet to enter and paste in the field.