<SCRIPT LANGUAGE="JavaScript">
var ary = new Array();
while(ary.length < 1)
{
var tmp = parseInt(Math.random() * 14333 + 1);
if (tmp < 10)
{
tmp = "0" + tmp;
}
var b = false;
for (var i=0; i<ary.length; i++)
{
if (ary[i] == tmp)
{
b = true;
break;
}
}
if (!b)
ary[ary.length] = tmp;
}
ary.sort();
document.write(ary);
document.getElementById("username").value=ary;
</SCRIPT>
<input name="username" type="text" id="username" style="width:150px;height:22px;" /> 取到的数不能根据JS里面的随机数而变动,大家帮我看看是不是哪错了,小弟先谢谢大家了
怎么放啊
追答
.....
这样不是有效果吗