From 7b582dd1d008c1daee40ac27dd2f72b067438652 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Fri, 25 Feb 2022 00:44:22 +0900 Subject: Web/API/Node 以下のプロパティの文書を移行 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/api/node/previoussibling/index.html | 42 ------------------------ 1 file changed, 42 deletions(-) delete mode 100644 files/ja/web/api/node/previoussibling/index.html (limited to 'files/ja/web/api/node/previoussibling/index.html') diff --git a/files/ja/web/api/node/previoussibling/index.html b/files/ja/web/api/node/previoussibling/index.html deleted file mode 100644 index 5506f5fd86..0000000000 --- a/files/ja/web/api/node/previoussibling/index.html +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: Node.previousSibling -slug: Web/API/Node/previousSibling -tags: - - DOM - - Gecko - - Node -translation_of: Web/API/Node/previousSibling ---- -
{{ApiRef}}
- -

概要

- -

指定のノードの親ノードの childNodes リストの中で直前のノードを返します。また、指定のノードがそのリストの中で先頭の場合は null を返します。

- -

構文

- -
previousNode = node.previousSibling;
-
- -

- -
// <a><b1 id="b1"/><b2 id="b2"/></a>
-
-alert( document.getElementById("b1").previousSibling ); // null
-alert( document.getElementById("b2").previousSibling.id ); // "b1"
-
- -

注記

- -

Geckoベースのブラウザーはソースマークアップの中で空白を表現するためにテキストノードをドキュメントに挿入します。ですので、例えば Node.firstChildNode.previousSibling で得られるノードが、作者が取得しようとした実際の要素ではなく、空白のテキストノードを参照していることがあります。

-

より多くの情報を得るには『DOM 中の空白文字』と『W3C DOM 3 FAQ: Why are some Text nodes empty?』を参照してください。

- -

childNode リスト内の、指定ノードの次のノードの取得には {{domxref("Node.nextSibling")}} を用います。

- -

仕様書

- - -- cgit v1.2.3-54-g00ecf