导航首页
排行榜单
申请收录
关于本站
搜索
本站
百度
搜狗
360
必应
头条
百度搜索
好资源导航
»
文章资讯
»
js实现随机点名系统(实例讲解)
js实现随机点名系统(实例讲解)
2023-09-23 01:30:06
131
废话不多说,直接上代码:
随机点名
td{ text-align:center; }
随机点名系统
varclassMate=["周远康","刘婷婷","戴娜","范凯","向彬", "胡波","胡辉","黄缘平","刘云","刘嘉鑫", "赵福全","王小妹","苏伟","李辉","曾伟", "李佳晓","钟仕文","张志强","袁鑫豪","余日成", "付立金","彭福康","邓慧佳","曹蓉","刘未东", "桂义","彭俊斌","周康华","曹增","蒋煜"]; //定义一个变量存随机数组 varindexArr; //打乱顺序 functionUpsetorder(){ alert(1); //初始化数组 indexArr=[]; //获取新的随机数 varrd=parseInt(Math.random()*classMate.length); while(true){ do{ varfalg=true; //循环获得每一个下标 for(vari=0;i