Hi,

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>
<script>
document.getElementById("b").addEventListener('click',function(){ alert("boo"); },false);
</script>
For the above code, i can detect the click event for button a as
Code:
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?

Thanks.