0
我已經在javascript中編寫了一個簡單的測驗,它在我選擇的瀏覽器中正常工作,但是當我在IE和FF中測試它時,按鈕不起作用。我得到一個「的ReferenceError:Option1button()沒有定義」Javascript onclick函數適用於除FF和IE之外的所有內容
即使在代碼這一點點我得到同樣的錯誤:
<!DOCTYPE HTML >
<html><head><title></title></head>
<body onload="loadPlayer();">
<script type="text/javascript">
function Option1button(){
document.getElementById("op1").style.display = 'none';
}
function loadPlayer() {
document.write("<div id=\"op1\"><button onclick='Option1button()'>choose</button> OPTIONS <br></div>");
}
</script>
</body>
</html>
是,就是這樣。謝謝! – Mark 2013-03-08 23:09:59