<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script type="text/javascript">
function tuxing(num){
if(num>9){
num=9;
}else if (num<2) {
num=2;
}
for(var i = num;i>=2;i--){
for(var j= 1;j<=i;j++){
document.write(i);
}
document.write("<br/>");
}
for(var i = 1;i<=num;i++){
for(var j= 1;j<=i;j++){
document.write(i);
}
document.write("<br/>");}
}
tuxing(9);
</script>
</body>
</html>