It is possible (compatible with cross-browser) with CANCEL keystroke after the user has done this (for example, in a text box)
The code I use changes the value of the text field after pressing the key:
$('.number').keypress(function() { this.value = this.value.replace(/[^0-9\.]/g, ''); });
javascript jquery textbox keypress keystroke
Jimbo
source share