<p>In javascript how do I get a handle on the frame that I'm in based on an element in that frame?</p>

<pre><code>function myFunction(elementInFrame){
   // here I want to get a handle on the frame that elementInFrame lives in
}
</code></pre>

In IE you can do
```
elementInFrame.document.parentWindow
```
Doesn't work in Firefox unfortunately.
Edit: If you're using frames then in FF you could do it the long way... loop through all the frames until you find the element you're looking for.