close

HTML 原始碼:

<form>
點擊下面按鈕
<input type="button" value="問題" onclick="alert('穆罕默德、牛頓、耶穌基督、釋迦牟尼、孔子、保羅、巴斯德、谷登堡、哥倫布、愛因斯坦,這10格人誰最長壽?'),alert('5秒倒數,計時開始!'),timer1ID=setTimeout('alert1()',5000)"/>
只有正確答案有反應
<input type="button" value="穆罕默德"/>
<input type="button" value="牛頓" onclick="clearTimeout(timer1ID),alert('恭喜你,答對了!')"/>
<input type="button" value="耶穌基督"/>
<input type="button" value="釋迦牟尼"/>
<input type="button" value="孔子"/>
<input type="button" value="保羅"/>
<input type="button" value="巴斯德"/>
<input type="button" value="谷登堡"/>
<input type="button" value="哥倫布"/>
<input type="button" value="愛因斯坦"/>
</form>

<script language="javascript">
function alert1()
{
alert("時間到!你出局了!")
}
</script>

範例網頁

arrow
arrow
    全站熱搜

    ALVIN 發表在 痞客邦 留言(0) 人氣()