Sharing variables using event object in html/jscript
<p>I have two functions as follows. Is there a way to access the variable "result" in the top function using "e" when I am not allowed to modify the bottom function? Here, the 'add' event is auto triggered by the button click.</p>

<pre><code>elem.addEventListener('add',function (e) {
    // need to do something with the variable "result"      
},true);

$(#myButton).click(function(evt) {
       var result = myFunction();
       if (result != null) {
       doSomething();
    }
});
</code></pre>
