English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Window frames attribute

Objet Window JavaScript

framesA read-only property returns an object similar to an array, representing all <iframe> elements in the current window.

You can access each <iframe> element using an index number, and the index starts from 0.

Useframes.lengthReturns the number of frames in the current window (including IFRAMES).

Note :This property also applies to <frame> elements. However, HTML5The <frame> element is not supported.

Syntax :

window.frames
var fr = window.frames;
fr[0].location = "https:"//fr.oldtoolbag.com/css-référence/";
Vérifiez et voyez‹/›

Compatibilité navigateur

Tous les navigateurs supportent complètement la propriété frames :

Propriété
framesOuiOuiOuiOuiOui

Détails techniques

Valeur de retour :Retourne une référence à l'objet fenêtre, représentant le nombre de frames dans la fenêtre actuelle

Plus d'exemples

Parcourir tous les frames et modifier la position de tous les frames :

var list = ["/tags/", "/css-référence/", "/jsref/", "/bootstrap/];
var fm = window.frames;
  
for (let i = 0; i < fm.length;++) {
fm[i].location = list[i];  
}
Vérifiez et voyez‹/›

Références associées

Référence fenêtre (Window) :Propriété window.frameElement

Référence fenêtre (Window) :Propriété window.parent

Référence des balises :Balise <iframe> HTML

Objet Window JavaScript