--- title: Window.frames slug: Web/API/Window/frames translation_of: Web/API/Window/frames ---
{{APIRef("DOM")}}
Возвращает само окно, являющееся объектом в виде массива, распечатывая элементы текущего окна.
frameList = window.frames;
frameList
is a list of frame objects. It is similar to an array in that it has a length
property and its items can be accessed using the [i]
notation.frameList === window
evaluates to true.window.frames[0]
is the same thing as document.getElementsByTagName("iframe")[0].contentWindow
).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"; }
Specification | Status | Comment |
---|---|---|
{{SpecName("HTML WHATWG", "browsers.html#dom-frames", "Window.frames")}} | {{Spec2("HTML WHATWG")}} | |
{{SpecName("HTML5 W3C", "browsers.html#dom-frames", "Window.frames")}} | {{Spec2("HTML5 W3C")}} |
{{Compat("api.Window.frames")}}