Prev Demo
JavaScript
>
Check Value Is Illegal Number
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to determine wheteher a number is an illegal number.</p> <input type="button" onclick="mySearch()" value="Check"> <p id="myId"></p> <script> function mySearch() { var P = isNaN(258) + "</br>"; //* This is Finite, legal number *// var Q = isNaN(25.8) + "</br>"; //* This is Finite, legal number *// var R = isNaN(2 * 5 * 8) + "</br>"; //* This is Finite, legal number *// var S = isNaN("258") + "</br>"; //* This is Finite, legal number *// var T = isNaN("Sheo Narayan") + "</br>"; //* This is illegal number *// var U = isNaN(0) + "</br>"; //* This is Finite, legal number *// var V = isNaN("09-Nov-2015"); //* This is illegal number *// var A = P + Q + R + S + T + U + V; document.getElementById("myId").innerHTML = A; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output