javascript 类似随机抽奖

javascript 类似随机抽奖360
var   alldata   =   "ASP,PHP,AJAX,ASP.NET,CSHARP,VB.NET,DELPHI,VB,VC,JS" //抽奖数据,以逗号分隔    var   alldataarr   =   alldata.split(",")     var   num   =   alldataarr.length-1     var   timer     function   change(){     document.getElementById("oknum").value   =   alldataarr[GetRnd(0,num)];     }         function   start(){     clearInterval(timer);     timer   =   setInterval('change()',46); //随机数据变换速度,越小变换的越快     }         function   ok(){     clearInterval(timer);     }         function   GetRnd(min,max){     return   parseInt(Math.random()*(max-min+1));     }

也许你还喜欢