From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- files/ko/web/api/node/previoussibling/index.html | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 files/ko/web/api/node/previoussibling/index.html (limited to 'files/ko/web/api/node/previoussibling/index.html') diff --git a/files/ko/web/api/node/previoussibling/index.html b/files/ko/web/api/node/previoussibling/index.html new file mode 100644 index 0000000000..642b896748 --- /dev/null +++ b/files/ko/web/api/node/previoussibling/index.html @@ -0,0 +1,42 @@ +--- +title: Node.previousSibling +slug: Web/API/Node/previousSibling +translation_of: Web/API/Node/previousSibling +--- +
+
{{APIRef("DOM")}}
+
+ +

Node.previousSibling은 읽기전용 속성이며 현재 호출하는 노드가 속해 있는 부모의 {{domxref("Node.childNodes", "childNodes")}} 목록에서 특정 자식 노드를 리턴하거나 childNodes 목록의 첫번째 노드일 경우 Null값을 리턴합니다.

+ +

Syntax

+ +
previousNode = node.previousSibling;
+
+ +

Example

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

Notes

+ +

Gecko 기반 브라우저는 소스 마크업에서 공백을 나타내기 위해 문서 내에 텍스트 노드를 삽입합니다. + 그러므로 예를 들어 Node.firstChildNode.previousSibling을 통해서 얻은 노드는 작성자가 얻으려 한 실제 요소와는 + 달리 공백 텍스트 노드를 참조할 지도 모릅니다.

+ +

더 많은 정보는 Whitespace in the DOM과 + W3C DOM 3 FAQ: Why are some Text nodes empty?를 보세요.

+ +

To navigate the opposite way through the child nodes list use Node.nextSibling.

+ +

Specification

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