<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<div id="show">
</div>
</body>
<script>
var num = 1
setInterval(function() {
var len = 3//显示的长度
num = parseInt(num, 10) + 1
num = num.toString()
while(num.length < len) {
num = '0' + num
}
document.getElementById('show').innerHTML = num
}, 10)
</script>
</html>
for(var i = 1i <10i ++){eval("var a" + i + "=" + i)
}
这样就a1=1,a2=2,a3=3......