I am trying to build a input field which will only take number as input so it's input type is number. But the keyboard visible on Android device is having a "." button on keyboard, so I am trying to prevent that button. using below code
onKeyDown = function(event){
console.log('KEY: ' + event.which);
if (event.which == 250 || event.which == 229) {
event.preventDefault();
}
};
229 is the ASCII code for the "." key of numbering keyboard in Android. Please help me
Updated: 1) This should work on mobile device. 2) Input type is "number" All solutions work on browser but not in mobile.
Thank You Sandip Jadhav