<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
*{margin:0;padding:0;}
span{
padding:2px;
margin:2px;
border:1px solid blue;
}
</style>
</head>
<body>
<div>
</div>
<script type="text/javascript">
var box = document.getElementsByTagName("div")[0];
var str = "";
for(var i=1;i<10;i++){
for(var j=1;j<=i;j++){
// str += "<span>${i}* ${j} =${i*j}</span>";
str += "<span>"+i+"*"+j+"="+i*j+"</span>"
// console.log(i+"*"+ j +"="+i*j)
}
str += "</br>"
}
box.innerHTML = str;
</script>
</body>
</html>
网友评论