实例:

<  type="text/ ">
alert(isNaN("123"));//弹出false;
alert(isNaN("12codeshare"));//弹出true;
</ >

注意:

使用isNaN()函数判断是否是数字时,当变量是空串时,isNaN()的返回值还是false,因为isNaN()把空串或空格作0处理的。

收藏 打印