input number 类型输入中文 光标异常
const input=document.querySelector('input[type=number]');
if(input){
input.oninput=(e)=>{
if(e.data===''&&e.target.value===''){
e.target.value='0'
setTimeout(()=>{
e.target.value=''
},0)
}
}
}
input number 类型输入中文 光标异常
发布时间 2023-09-04 16:38:09作者: 7c89