--- title: Window.length slug: Web/API/Window/length translation_of: Web/API/Window/length ---
{{ ApiRef() }}

Liefert die Anzahl an Frames ({{HTMLElement("frame")}} oder {{HTMLElement("iframe")}} elements) im aktuellen Fenster.

Syntax

framesCount = window.length;

Beispiel

if (window.length) {
  // this is a document with subframes
}

Spezifikationen

Specification Status Comment
{{SpecName('HTML WHATWG','browsers.html#dom-length','Window.length')}} {{Spec2('HTML WHATWG')}}  
{{SpecName('HTML5 W3C', 'browsers.html#dom-length', 'Window.length')}} {{Spec2('HTML5 W3C')}}  

Browserkompatibilität

{{Compat("api.Window.length")}}