var a=document.getElementById("a");
var i2=document.getElementById("i2");
let name;
let l=["111","123","564","999","954","654","365","211","911","778","698","365","468","777","831","126"];
// alert(l.length);
//a.innerHTML=l[Math.round(Math.random()*(l.length-1))];
function sleep(){
flag=true; //设置标志,判断停止时间
setTimeout(change,50); //随机跳动,延时50毫秒
}
i2.onclick=function(){
flag=false; //结束标志
}
function change(){
name = l[Math.floor(Math.random()*l.length)]; //随机取值
console.log(name);
if(!flag){
a.innerHTML=name;
}else{
a.innerHTML=name;
sleep(); //迭代
}
}