Help! How to get the event handler with IE Dom interfaces?
        Posted  
        
            by usfree74
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by usfree74
        
        
        
        Published on 2010-05-26T01:18:09Z
        Indexed on 
            2010/05/26
            1:21 UTC
        
        
        Read the original article
        Hit count: 344
        
Hey Gurus,
I am working to use IE Dom interface to automate IE page access. I am trying to get all event handlers defined in a page. I am using IHTMLElement object now for this purpose. If the html page defines "onclick=xxx", element.onclick returns the click handler. However, if an event handler is defined in javascript, element.onclick simply returns NULL. What's the right way to get the event handler then?
Thanks, xin
Below is an example that uses javascript to define event handler.
$(document).ready(function(){ $("a").click(function(event){ $(this).hide("slow"); alert("Thanks for visiting!"); window.location="http://cnn.com"; }); }); jQuery
© Stack Overflow or respective owner