Its not like this question has not been asked anywhere. But I need some specific implementation of the mentioned problem. I need to know if the 'video' tag has registered event handler or not in the application. I tried it using the jQuery methods but it simply does not work. I am new to jQuery, so may be I am doing it in a wrong way. Here is what I referred How to check if element has click handler?
var ev = $._data(element, 'events');
I implemented it like this
var ev = $._data($('video')[0], 'volumechange');
where $('video')[0] holds the HTML video tag.
The above query always returns
unidentified
So, where am I going wrong? My application has an event handler registered to it
<script>
video.addEventListener('volumechange', handleVideoEvent, false);
</script>
I expect
var ev = $._data($('video')[0], 'volumechange');
to return
handleVideoEvent object.
And moreover is jQuery the only way to get the registered event handlers. Is there a way in Javascript itself?