JavaScript by Monkey Wu

樂透選號程式

將下列程式碼複製至<head>程式碼</head>區內

<form name="mark">
<table border="1" cellpadding="2" cellspacing="0" width="40%" bordercolor="#FFCC99">
<tr>
<td width="100%">
<p align="center"><font size="2" color="#C0C0C0">JavaScript by Monkey Wu</font></p>
<p><input type="button" value="啟動Monkey Wu樂透機" name="B1" onclick="monkeyGO()" style="color: #3399FF; background-color: #FFFFFF; border: 1 solid #C0C0C0; cursor:hand"></p>
<p><input type="text" name="T1" size="5" style="color: #FF0000; font-weight: bold; background-color: #FFFFFF; border: 1 solid #C0C0C0">
<input type="button" value="我要?號" name="B2" onclick="monkeyWANT()" style="color: #FF5BAD; background-color: #FFFFFF; border: 1 solid #C0C0C0; cursor:hand">
</p>
<p><input type="text" name="T2" size="23" style="color: #FF9933; background-color: #FFFFFF; border: 1 solid #C0C0C0">
<input type="button" value=" 清除號碼 " name="B3" onclick="document.mark.T2.value = ''" style="color: #FF5BAD; background-color: #FFFFFF; border: 1 solid #C0C0C0; cursor:hand">
</p>
</td>
</tr>
</table>
</form>

<script language="JavaScript">
/*
歡迎使用在您的網站套用本程式
增加您網站的人氣與互動性
請不要將"JavaScript by Monkey Wu"刪除
謝謝您滴配合!
Http://way.to/monkeywu
Http://www.monkeywu.tk
monkeywu_2002@yahoo.com.tw
【閱讀完畢可刪除本說明區塊】
*/
document.title = "monkeywu_2002@yahoo.com.tw 歡迎來信指教" //網頁標題, 可刪除
document.mark.B2.disabled = true;
i=1; //起始數字
function monkeyGO(){
if(i < 43){
if(i<10)
document.mark.T1.value = " 0"+i;
else
document.mark.T1.value = " "+i;
i++;
}
else
i=1;
speed = 15; //設定速度, 值越大越慢
monkeywu = setTimeout("monkeyGO()",speed);
document.mark.B1.disabled = true;
document.mark.B2.disabled = false;
}
function monkeyWANT(){
check = document.mark.T2.value.length; //取得T2欄位字元長度
if(check > 15){
clearTimeout(monkeywu);
document.mark.T1.value = "";
document.mark.B1.disabled = false;}
else
document.mark.T2.value += document.mark.T1.value;
}
</script>