爲什麼不能使用此代碼?我使用FF。getElementById和null - 爲什麼?
<head>
<script type="text/javascript">
document.getElementById("someID").onclick = function(){
alert("Yahooo");
}
</script>
</head>
<body>
<a href="#" id="someID">someID</a>
</body>
</html>
我收到了javascript錯誤getElementById等於null。
OMG!捂臉。謝謝 :) – lunar 2012-01-14 19:31:14