1
2<html>
3<head></head>
4<body>
5<h1>isNaN() example</h1>
6
7<script type="text/javascript">
8 var num1 = 100;
9 if(isNaN(num1)){
10 document.write(num1 + " is not a number <br/>");
11 }else{
12 document.write(num1 + " is a number <br/>");
13 }
14
15 var str1 = "mkyong"
16 if(isNaN(str1)){
17 document.write(str1 + " is not a number <br/>");
18 }else{
19 document.write(str1 + " is a number <br/>");
20 }
21</script>
22
23</body>
24</html>
25