为什么不能使用此代码?我使用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