'Enumerate all events attached to HTML objects of a document
After a lot of googling, I am here to ask if it is possible to enumerate all the events attached to HTML elements in a DOM.
For example: Suppose my document is
<body onscroll=docScrolled()>
<span onmouseover=doSomethingElse()> Span is here </span>
<div id="container">
<script>
$("#container").bind("click", doSomething);
</body>
After my document has been loaded and all the javascript code executed, I want to provide a button on clicking which display all the HTML elements and the events attached to them.
Ouptut
<body onscroll=docScrolled()> ------ onscroll
<span onmouseover=doSomethingElse()> Span is here </span> -----onmouseover
<div id="container"> ------onclick
So ultimately question is How to enumerate over all HTML elements and find out the events attached to them.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
