How to get Events associated with DOM elements?

后端 未结 4 2230
遥遥无期
遥遥无期 2021-02-14 02:27

I have an HTML document.
It is possible to get the events associated with every Element in a particular FORM element in the document using javascrip

4条回答
  •  终归单人心
    2021-02-14 03:09

    There is a very good tool visual event that would display all the events associated with element visually.

    Add the following code at the end of each page that you want to monitor.

    This will make the page disable and highlight all the events with icons and also show what they are doing by taking the cursor on that icon.

    (function()
    {
        if(typeof VisualEvent!='undefined')
        {
            if(document.getElementById('Event_display'))
            {
                VisualEvent.fnClose();
            }else{
                VisualEvent.fnInit();
            }
        }else
        {
            var n=document.createElement('script');
            n.setAttribute('language','JavaScript');
            n.setAttribute('src','http://www.sprymedia.co.uk/design/event/media/js/event-loader.js');
            document.body.appendChild(n);
        }
    })();
    

    Please read visual event for detail.

提交回复
热议问题