I want to know the DOM event (say click) associated with a DOM element.

HTML Source:
HTML Code:
<button id="a" onclick="sayHello()">Say Hello</button>
<button id="b"></button>
document.getElementById("b").addEventListener('click',function(){ alert("boo"); },false);
For the above code, i can detect the click event for button a as
if(document.getElementById("a").onclick != undefined){ alert('event associated'); }else{ alert('no event'); }
But this doesn't work for button "b". Does anyone know how i can get the events added by addEventListener?