-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfactorial.html
49 lines (41 loc) · 1.33 KB
/
factorial.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<script type="text/javascript" src="scripts/factorial.js"></script>
<link rel="stylesheet" type="text/css" href="styles/main1.css" />
<script type="text/javascript">
function computeFactorial() {
nvalue = document.FactorialForm.factorialInput.value
factorialResult = factorial(nvalue);
var resultField = document.getElementById('factorial_result');
resultField.innerHTML = factorialResult;
}
</script>
<title>Coho Math</title>
</head>
<body>
<div class="header">
<h1>Coho Math</h1>
<h2>Math functions explained</h2>
</div>
<div class="navigator"><a name="cua"></a>
<ul>
<li><a href="index.html">Home</a></li>
<li class="activeNavigator"><a href="">Factorial</a></li>
<li><a href="summorial.html">Summorial</a></li>
<li><a href="random.html">Random</a></li>
</ul>
</div>
<div id="content">
<h1>Factorial</h1>
<p> The factorial is the product of all positive integers less than or equal to n. For example,
5! = 5 * 4 * 3 * 2 * 1 = 120
</p>
<form name="FactorialForm">
<input name="factorialInput" type="text" title="Factorial"/> = <span id="factorial_result">result</span>
<p><input type="button" value="Calculate Factorial" onclick="computeFactorial()"/></p>
</form>
</div>
</body>
</html>