📅  最后修改于: 2022-03-11 15:01:07.150000             🧑  作者: Mango
$("#_property_price").on("keypress", function(event) {
var englishAlphabetDigitsAndWhiteSpace = /[A-Za-z0-9 ]/g;
var key = String.fromCharCode(event.which);
alert(event.keyCode);
if (event.keyCode == 8 || event.keyCode == 37 || event.keyCode == 39 || englishAlphabetDigitsAndWhiteSpace.test(key)) {
return true;
}
return false;
});
$('#mytextbox').on("paste",function(e)
{
e.preventDefault();
});