When I enter the integer, I'm not getting the prompt that states if it is odd or even. I am new to this, so this stupid thing has taken me a week to do, but now I am just frustrated. Can someone help me out.
<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- Fig. 6.9: addition.html -->
<!-- Addition script. -->
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title>Odd or Even</title>
<script type = "text/javascript">
<!--
// Determine if number is odd or even
Function OddEven(number)
// convert number from type string to type Int
x = Integer.parseInt ( xNumber );
if ( x % 2 == 0 )
if ( x % 2 != 0 )
// display odd or even integer
document.writeln(
"<h1>Integer is "odd or even"</h1>" );
End If
End Function
// Convert input to long integers
Sub CmdButton_OnClick()
Dim number
number=CLng(Document.forms(0).n1.Value)
Call OddEven(number)
End Sub
// -->
</script>
</head>
<body>
<form name="form1" id="form1" method="post" action="">
<p>
<input type="text" name="n1" />
Enter a number greater than 0</p>
<p>
<input type="submit" name="CmdButton" value="Compute" />
</p>
<p>
<input type="reset" name="Reset" value="Reset" />
</p>
</form>
</body>
</html>