JavaScript检查输入的是否是数字或英文字

 

var txt=window.document.form1.text1.value;
re = /\W/;
if (re.test(txt))
{
    alert("只允许输入英文及数字");
    return false;
}
else
{
    window.alert('英文及数字');
} 

相关文章:

  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-17
  • 2021-06-21
  • 2022-12-23
  • 2021-09-09
  • 2021-07-21
相关资源
相似解决方案