for(var i=1;i<10;i++){
var arr=[];
for(var j=1;j<=i;j++){
arr.push(j)
}
console.log(arr+'')
}
<div class="stair">
</div>
.clearfix:after{
content: '';
display: block;
height: 0;
visibility: hidden;
clear: both;
}
.clearfix{
*zoom:1;
}
.square{
width:20px;height:20px;
background: lightcoral;
float:left;
}
var stair=$('.stair');
for(var i=1;i<10;i++){
var oDiv=$('<div></div>');
oDiv.addClass('clearfix');
for(var j=1;j<=i;j++){
var square=$('<div></div>');
square.addClass('square');
oDiv.append(square);
}
stair.append(oDiv);
}