我有一个文本字段。我想让这个字段只接受 10 位数字,如果输入的数字大于 10 或小于 10,则抛出错误
<td><input name="Number" type="text" id="Number" value="" required/></td>
document.getElementById('Number').onchange = function()
{
if(this.value > 11){
this.value = "Please Check the Ticket Number Again";
}
if(this.value < 10){
this.value = "Please Check the Ticket Number Again";
}
}