--- title: Window.frames slug: Web/API/Window/frames translation_of: Web/API/Window/frames --- <p>{{APIRef("DOM")}}</p> <p>Возвращает само окно, являющееся объектом в виде массива, распечатывая элементы текущего окна.</p> <h2 id="Syntax">Syntax</h2> <pre class="eval"><em>frameList</em> = window.frames; </pre> <ul> <li><code>frameList</code> is a list of frame objects. It is similar to an array in that it has a <code>length</code> property and its items can be accessed using the <code>[i]</code> notation.</li> <li><code>frameList === window</code> evaluates to true.</li> <li>Each item in the window.frames pseudo-array represents the <a class="internal" href="/en/DOM/window" title="en/DOM/window">window</a> object corresponding to the given <a class="internal" href="/en/HTML/Element/frame" title="en/HTML/Element/frame"><frame></a>'s or <a class="internal" href="/en/HTML/Element/iframe" title="en/HTML/Element/iframe"><iframe></a>'s content, not the (i)frame DOM element (i.e., <code>window.frames[0]</code> is the same thing as <code>document.getElementsByTagName("iframe")[0].contentWindow</code>).</li> <li>For more details about the returned value, refer to this <a class="external" href="http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/5628c6f346859d4f/169aa7004565066?hl=en&ie=UTF-8&oe=utf-8&q=window.frames&pli=1" title="http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/5628c6f346859d4f/169aa7004565066?hl=en&ie=UTF-8&oe=utf-8&q=window.frames&pli=1">thread on mozilla.dev.platform</a> [dead link].</li> </ul> <h2 id="Example">Example</h2> <pre class="brush: js">var frames = window.frames; // or // var frames = window.parent.frames; for (var i = 0; i < frames.length; i++) { // do something with each subframe as frames[i] frames[i].document.body.style.background = "red"; } </pre> <h2 id="Specifications">Specifications</h2> <table class="spectable standard-table"> <tbody> <tr> <th scope="col">Specification</th> <th scope="col">Status</th> <th scope="col">Comment</th> </tr> <tr> <td>{{SpecName("HTML WHATWG", "browsers.html#dom-frames", "Window.frames")}}</td> <td>{{Spec2("HTML WHATWG")}}</td> <td> </td> </tr> <tr> <td>{{SpecName("HTML5 W3C", "browsers.html#dom-frames", "Window.frames")}}</td> <td>{{Spec2("HTML5 W3C")}}</td> <td> </td> </tr> </tbody> </table> <h2 id="Browser_compatibility">Browser compatibility</h2> <p>{{Compat}}</p>