window.onload=function() { alert("onload"); div_element=document.getElementById("xyz"); alert(div_element); div_element.onmouseover=function () { alert("hallo" + this); } }