1<input type="text" onkeypress="return isNumberKey(event)" placeholder="Phone Number">
2//this will accept only numbers from 0 to 9
3<script>
4function isNumberKey(evt)
5{
6 var charCode = (evt.which) ? evt.which : event.keyCode
7 if (charCode > 31 && (charCode < 48 || charCode > 57))
8 return false;
9
10 return true;
11}
12</script>