aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/node/parentelement/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/web/api/node/parentelement/index.html')
-rw-r--r--files/ja/web/api/node/parentelement/index.html92
1 files changed, 92 insertions, 0 deletions
diff --git a/files/ja/web/api/node/parentelement/index.html b/files/ja/web/api/node/parentelement/index.html
new file mode 100644
index 0000000000..a5b9e2a3b4
--- /dev/null
+++ b/files/ja/web/api/node/parentelement/index.html
@@ -0,0 +1,92 @@
+---
+title: Node.parentElement
+slug: Web/API/Node/parentElement
+tags:
+ - DOM
+ - Element
+ - Node
+ - Property
+ - parent
+translation_of: Web/API/Node/parentElement
+---
+<div>
+<div>{{APIRef("DOM")}}</div>
+</div>
+
+<p><strong>Node.parentElement</strong>のread-only プロパティはDOM ノード上の親の {{domxref("Element")}} を返します。親ノードが存在しない場合や親ノードが DOM {{domxref("Element")}} で無い場合、<code>null</code> が返ります。</p>
+
+<h2 id="Syntax" name="Syntax">構文</h2>
+
+<pre class="syntaxbox"><var>parentElement</var> = <em>node</em>.parentElement</pre>
+
+<p><code>parentElement</code>は現nodeの親elementです。型は必ずDOM {{domxref("Element")}} オブジェクトか<code>nullです</code>。</p>
+
+<h2 id="Example" name="Example">例</h2>
+
+<pre class="brush:js">if (node.parentElement) {
+ node.parentElement.style.color = "red";
+}</pre>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザ実装状況</h2>
+
+<p>一部のブラウザーでは、<code>parentElement</code>プロパティは {{domxref("Element")}} ノードでのみ定義されており、特にテキストノードに対して定義されていない場合がある点に注意して下さい。</p>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>機能</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>基本サポート</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoDesktop("9.0")}}</td>
+ <td>{{CompatVersionUnknown}} ({{domxref("Element")}} にのみ実装)</td>
+ <td>{{CompatVersionUnknown}} ({{domxref("Element")}} にのみ実装)</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>機能</th>
+ <th>Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>基本サポート</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoMobile("9.0")}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="Specification" name="Specification">仕様</h2>
+
+<ul>
+ <li>{{spec("http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#parent-element", "DOM Level 4: Node.parentElement", "WD")}}</li>
+</ul>
+
+<h2 id="See_also" name="See_also">関連情報</h2>
+
+<ul>
+ <li>{{domxref("Node.parentNode")}}</li>
+</ul>