Results for category "Js学习"

learn Js from the beginning

1-1一个简单的javascript程序

<html>
<head><title>title</title></head>
<body>
<h2>table of factorials</h2>
<script>
var fact=1;
for(i=1; i<10; i++){
fact=fact*i;
document.write(i+”!=”+fact+”<br>”);
}
</script>
</body>
</html>

 

效果:

table of factorials

1!=1
2!=2
3!=6
4!=24
5!=120
6!=720
7!=5040
8!=40320
9!=362880