本人剛剛開始自學js,本意是根據(jù)輸入提示框輸入的數(shù)字輸出一個乘法表,比如輸入1就輸出1*1=1....到1*9=9,輸入5就輸出5*5=25...到5*9=45?,F(xiàn)在不知道問題出在哪....<!DOCTYPE html>
?<html lang = "en">
?<head><title>excercise1</title>
?</head>
?<body>
<script>
function chengfachart(chengshu0){??var chengshu0 = parseFloat(prompt("enter chengshu","1")); ??var chengshu1 = chengshu0;
??for(var chengshu1 = chengshu0;chengshu1 <= 8;chengshu1++);
??{
??var deshu = chengshu1*chengshu0;
??document.write(chengshu1+"\*"+chengshu0+"\="+deshu+"<br/>");
??}
}
??chengfachart()
;</script>
?</body>
?</html>
為什么輸出乘法表只能輸出一行?
VulpesXu
2016-10-13 08:49:41