<script type="text/javascript">
aLabe = document.getElementById('alabel') ;
function init(){
aLabe.innerHTML= "asdf" ;
}
</script>
<body onload="init()">
<div id="container">
<div id="header" > Google maps Intro 1</div>
<div id="alabel">Yo!!</div>
<div id="map_canvas"></div>
</div>
</body>
In the above,line 4 throws an aLabe is null error. Why is this? isn't aLabe a global var which is called before init()? If so then why doesn't init have access to aLabe ?