Can I access the function body of an event listener using nodeJS jsdom
- by Zhami
I am using jsdom with nodeJS. I load in a large HTML document, and am using jQuery to navigate the DOM. I have a case where I have an element, and I need to access the function body of an event listener (onclick). The event listener was added in the source HTML:
<a href="#" onclick="javascript:window.open('http://<rest-of-url>'); return false;"></a>
The onclick attribute of the DOM element is undefined.
btw: what I really want to do is get the URL (please note that <rest-of-url> is not what is in the source, a real URL spec is there) that is specified in the source.