Window: frames property

Returns the window itself, which is an array-like object, listing the direct sub-frames of the current window.

Value

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.

Examples

js
const frames = window.frames; // or const frames = window.parent.frames;
for (let i = 0; i < frames.length; i++) {
  // do something with each subframe as frames[i]
  frames[i].document.body.style.background = "red";
}

Specifications