3
我在HTML页面中的链接,它具有id="redirect"
帮助错误SCRIPT5007:无法设置的属性值的“onClick”
而这(的script.js)
window.onload = initAll();
function initAll(){
document.getElementById("redirect").onclick = clickHandler;
}
function clickHandler(){
alert("Sure!");
return true;
}
我收到此错误信息
SCRIPT5007: Unable to set value of the property 'onclick': object is null or undefined
我想这(IE9,IE8,Chrome浏览器,火狐4.0.1),但仍不能运行,请大家帮忙