aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/node/ownerdocument/index.html
blob: 35b5eb68591b831cedd480ca10e77ac779100a47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
title: element.ownerDocument
slug: Web/API/Node/ownerDocument
tags:
  - API
  - DOM
  - Document
  - Noeuds
  - Propriétés
translation_of: Web/API/Node/ownerDocument
---
<p>{{APIRef("DOM")}}</p>

<p>La propriété en lecture seule <code><strong>Node.ownerDocument</strong></code> renvoie l'objet document de niveau supérieur pour ce nœud.</p>

<h2 id="Syntaxe">Syntaxe</h2>

<pre class="eval"><em>document</em> = element.ownerDocument;
</pre>

<ul>
 <li><code>document</code> est l'objet <a href="/fr/docs/Web/API/document"><code>document</code></a> parent de l'élément courant.</li>
</ul>

<h2 id="Exemple">Exemple</h2>

<pre class="brush: html">// étant donné un nœud "p", obtient le premier enfant HTML
// de l'objet document
var d = p.ownerDocument;
var html = d.documentElement;
</pre>

<h2 id="Notes">Notes</h2>

<p>L'objet <code>document</code> renvoyé par cette propriété est l'objet principal avec lequel tous les nœuds enfants du document HTML réel sont créés. Si cette propriété est utilisée sur un nœud qui est lui-même un document, le résultat est <code>null</code>.</p>

<h3 id="Sp.C3.A9cification">Spécifications</h3>

<table class="standard-table">
 <tbody>
  <tr>
   <th>Spécification</th>
   <th>Statut</th>
   <th>Commentaire</th>
  </tr>
  <tr>
   <td>{{SpecName("DOM4", "#dom-node-ownerdocument", "Node.ownerDocument")}}</td>
   <td>{{Spec2("DOM4")}}</td>
   <td> </td>
  </tr>
  <tr>
   <td>{{SpecName("DOM3 Core", "core.html#node-ownerDoc", "Node.ownerDocument")}}</td>
   <td>{{Spec2("DOM3 Core")}}</td>
   <td>Pas de changement</td>
  </tr>
  <tr>
   <td>{{SpecName("DOM2 Core", "core.html#node-ownerDoc", "Node.ownerDocument")}}</td>
   <td>{{Spec2("DOM2 Core")}}</td>
   <td>Définition initiale.</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>

<p>{{Compat("api.Node.ownerDocument")}}</p>