function noDupNum(){ // to remove the selected mobile phone number mobile.removeEleAt(randnum); // to reorganize the mobile number array!! var o = 0; for(p=0; p<mobile.length;p++){ if(typeof mobile[p]!="undefined"){ mobile[o] = mobile[p]; o++; } } num = mobile.length-1; } // method to remove the element in the array Array.prototype.removeEleAt = function(dx) { if(isNaN(dx)||dx>this.length){return false;} this.splice(dx,1); } // set mobile phone numbers to the table cell function setValues(){ document.getElementById(cellnum).value = document.getElementById("result").value ; cellnum++; } </script> </head> <body> <center> <div> </div> <div id="main"> <div> <h1>中奖号码</h1> <p> <input id="result" type="text" size="30" style="height:130px;width:800px;border:2px solid red;font-size:120;" readonly/></p> <p> <input id="start" type="button" value="开始" style="border: 1px solid; border-color: #aaa 000 #000 #aaa;width:4em; background: #fc0;" onclick="setTimer()" /> <input id="end" type="button" value="停" style="border: 1px solid; border-color: #aaa 000 #000 #aaa;width:4em; background: #fc0;"onclick="clearTimer();setValues();" disabled/> </p> <p><strong>一等奖(10名)</strong></p> <table width="946" height="79" border="1"> <tr> <td><input name="text36" type="text" id="36" style="height:30px;width:190px;border:1px solid red;font-size:25;" size="28" readonly/></td> <td><input name="text37" type="text" id="37" style="height:30px;width:190px;border:1px solid red;font-size:25;" size="20" readonly/></td> <td><input name="text38" type="text" id="38" style="height:30px;width:190px;border:1px solid red;font-size:25;" size="20" readonly/></td> <td><input name="text39" type="text" id="39" style="height:30px;width:190px;border:1px solid red;font-size:25;" size="20" readonly/></td> <td><input name="text40" type="text" id="40" style="height:30px;width:190px;border:1px solid red;font-size:25;" size="20" readonly/></td> </tr> <tr> <td><input name="text41" type="text" id="41" style="height:30px;width:190px;border:1px solid red;font-size:25;" size="28" readonly/></td> <td><input name="text42" type="text" id="42" style="height:30px;width:190px;border:1px solid red;font-size:25;" size="20" readonly/></td> <td><input name="text43" type="text" id="43" style="height:30px;width:190px;border:1px solid red;font-size:25;" size="20" readonly/></td> <td><input name="text44" type="text" id="44" style="height:30px;width:190px;border:1px solid red;font-size:25;" size="20" readonly/></td> <td><input name="text45" type="text" id="45" style="height:30px;width:190px;border:1px solid red;font-size:25;" size="20" readonly/></td> </tr> </table> <p>二等奖(15名)</p> <table width="951" height="88" border="1"> <tr>
|
正在阅读:用Javascript轻松制作抽奖系统用Javascript轻松制作抽奖系统
2006-12-04 09:16
出处:
责任编辑:lizhe
键盘也能翻页,试试“← →”键