js写九九乘法表
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script>
for (i=1 ; i<=9 ; i++){
for(j=1 ; j<=i ; j++){
document.body.innerHTML += i+"*"+j+"="+i*j+" "
}
document.write("<br>");
}
</script>
</body>
</html>
效果图:
第一次写九九乘法表用了这么少的代码!开心!