How do I get the Window object from the Document object?

Joren picture Joren · Aug 27, 2009 · Viewed 70.5k times · Source

I can get window.document but how can I get document.window? I need to know how to do this in all browsers.

Answer

kennebec picture kennebec · Aug 27, 2009

You can go with document.defaultView if you’re sure its a window and its okay to skip Microsoft browsers before IE 9.