的我有以下的代码,但它是不会放弃的阶乘完美的结果u能找到它PLZ阶乘一些
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<script type="text/javascript">
function fact(num)
{
var x=parseInt(num);
//alert(x+1);
if(x>0)
x=x* fact(x-1);
alert(x);
}
</script>
</head>
<body>
<form name="f1">
Enter the Number :<input type="text" length="8" name="txt1"><br>
<input type="button" value="Find factiorial" onclick="fact(txt1.value)">
</form>
</body>
</html>
http://stackoverflow.com/search?q=javascript+factorial – 2010-12-14 10:29:49
https://jsfiddle.net/mohittadhiyal/6w64x0sL/10/ – Mohit 2018-03-01 09:41:51