why return false is not working in below code
<p>there are some anchor tags in my code, But I dont want ,by clicking on link page should load link, I want to alert when click on anchor tag , and further, click event  should not get executes.</p>

<pre><code>window.onload=function(){ 
  var x=document.getElemenByTagName('a');
  for(var i=0;i&lt;x.length;i++)
    x[i].addEventListener('click',doAlert,false);
  function doAlert(){
    alert('not allowed')
    return false;
  }
}
</code></pre>

<p><em><strong>my problem here is anchor tag gets executed</strong></em></p>
