function checkNum(obj){ if(!isNaN(obj.value)){ alert("是数字类型!"); }else{ alert("不是数字类型!"); } }