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.

Javascript: IF ELSE IF



<html>
<head>
<title>IFELSE</title>

<script language="javascript">
function checkage()
{
var age=f1.t1.value;
if(age>18)
document.write("Your age is greater than 18 years<br>");
else if(age==18)
document.write("Your age is 18 Years");
else
document.write("Yoru age is smaller than 18 years");
}
</script>

</head>
<body>

<form name="f1">
<input type="text" name=t1>
<input type="button" value="Check" onclick="checkage()">

</body>
</html>

No comments:

Post a Comment

Google