我只想写数字 所以我就这么做了
$('#myId').on('keydown', '#myInput',function(event){
var charCode = (event.which) ? event.which : event.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
event.preventDefault();
}
//...
})
这段代码在英语中运行得很好。但此代码在韩文(韩语)中不起作用。 文本是在事件发生之前写下的。
谁来帮帮我
使用 oninput=""
<input type="text" oninput="yourFunc(this.value)" id="email">