English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
parentA read-only property that returns the parent window of the current window.
If the window has no parent window, its parent property is a reference to itself.
When a window is loaded into an <iframe>, <object>, or <frame>, its parent window is the window that contains the element embedding the window.
window.parent
parent.document.body.style.backgroundColor = "coral";Tester voir‹/›
Tous les navigateurs supportent complètement la propriété parent :
Propriété | |||||
parent | Oui | Oui | Oui | Oui | Oui |
Retour valeur : | Objet parent de la fenêtre actuelle |
---|
Afficher la position de la fenêtre parent lors de l'ouverture d'une nouvelle fenêtre :
window.open("", "", "largeur=300, hauteur=200"); document.getElementById("output").innerHTML = window.parent.location;Tester voir‹/›
Référence Fenêtre (Window) :Propriété window.frameElement
Référence Fenêtre (Window) :Propriété window.self
Référence Fenêtre (Window) :Propriété window.top
Référence des balises :Balise <embed> HTML
Référence des balises :Balise <object> HTML
Référence des balises :Balise <iframe> HTML