window.length

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

We’d love to hear your thoughts on the next set of proposals for the JavaScript language. You can find a description of the proposals here.
Please take two minutes to fill out our short survey.

概要

ウィンドウにおけるフレーム(<frame><iframe> 要素のいずれか)の数を返します。

構文

framesCount = window.length;
  • framesCount はフレームの数です。

js
if (window.length) {
  // サブフレーム数が 0 でない場合の処理をここに記述
}

仕様書

Specification
HTML
# dom-length-dev