Visit Mozilla.org

DOM:window.frames

From MDC

« Gecko DOM Reference

Contents

[edit] Summary

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

[edit] Syntax

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.

[edit] Example

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";
}

[edit] Specification

DOM Level 0. Not part of any standard.