Here you can find a number of examples on Java Script.Please find the various kinds of examples listed on the right side of this site. If you don't find anything on Java Script then please write to us or leave a commnet. We are pleased to help and find the solution of your problem.
Showing posts with label isNaN. Show all posts
Showing posts with label isNaN. Show all posts
JavaScript: isNaN Function
isNaN Function :-
Evaluates an argument to determine if it is not a number.
Syntax :-
isNaN(value)
value = The value you want to evaluate.
Description :-
isNaN is a top-level function and is not associated with any object.
On platforms that support NaN, the parseFloat and parseInt functions return NaN when they evaluate a value that is not a number. isNaN returns true if passed NaN, and false otherwise.
Example:
<html>
<head>
<title>isNaN Fnction</title>
<script language="javascript">
function check()
{
var phone=f1.phone.value;
if(isNaN(phone))
alert("Characters are not allowed in the Phone Number");
else
alert("Your Phone Number is Accepted");
}
</script>
</head>
<body>
<form name="f1">
Phone: <input type="text" name="phone" size="20">
<input type="button" value="check" onclick="check()">
</form>
</body>
</html>
Labels:
function,
functions,
in,
isNaN,
javascript,
javascriptexample,
math
Subscribe to:
Posts (Atom)