Javascript not working in FF or IE
<p>I have some javascript code that gets the id of the element selected by the user, it works absolutely fine with Chrome, Safari, Opera but when it comes to Firefox and IE it doesn't seem to work at all.</p>

<p>It is located within a closure function and I have done some tests and found that it is this exact line that is breaking the code. </p>

<p>my function...</p>

<pre><code>var myfunction = (function(){

    var testId;
    var item1;
    var item2;

    return{

         animate: function(){

             testId = window.event.target.id;

             item1 = $('#heading' + testId);
             item2 = $('#subheading' + testId);

             //jquery operating on item1 and item2 goes here

         }
    };
}());
</code></pre>

<p>line that doesn't seem to be working...</p>

<pre><code>testId = window.event.target.id;
</code></pre>

<p>Any help with this problem would be much appreciated.</p>
