判断是否是NaN

if (isNaN(parseInt(x))) {

alert("非数字");

else{

alert("数字");

}

原文地址:https://www.cnblogs.com/linsx/p/8567269.html