I am working with PhantomJS and want to analyze existing elements on the DOM. Let's say I have an element to which there is an onclick function attached. Since PhantomJS is a browser and has access to all the existing scripts, I am wondering if I can get the whole body of that function without executing it.
for example, assume I have following element:
<button type='button' onclick=myfunction('40')>
Now, I am wondering if there is a way by which I can get the whole body of 'myfunction()' or the way by which I can see the result of the execution of this function without clicking on that button?