1、矩形
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
//嵌套循环:外层循环一次,内层循环一轮
//矩形
for (var j = 1; j <= 5; j++) {
for (var i = 1; i <= 5; i++) {
document.write("*")
}
document.write("<br>")
}
</script>
</body>
</html>
1、 平行四边形
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
//平行四边形
for (var j = 1; j <= 5; j++) {
for (var k = 5; k > j; k--) {
document.write("