이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 함께 해서 번역을 마치도록 도와 주세요!
The Node.parentElement
read-only property returns the DOM node's parent Element
, or null
if the node either has no parent, or its parent isn't a DOM Element
.
Syntax
parentElement = node.parentElement
parentElement
is the parent element of the current node. This is always a DOM Element
object, or null
.
Example
if (node.parentElement) { node.parentElement.style.color = "red"; }
Browser compatibility
On some browsers, the parentElement
property is only defined on nodes that are themselves an Element
. In particular, it is not defined on text nodes.
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | (Yes) | 9.0 (9.0) | (Yes) (only on Element ) |
(Yes) (only on Element ) |
(Yes) |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | ? | 9.0 (9.0) | ? | ? | ? |
Specification
See also
문서 태그 및 공헌자
태그:
이 페이지의 공헌자:
mrenty,
fscholz,
teoli,
kscarfone,
Reachmeatshivam,
ethertank,
Sheppy,
claudepache,
ziyunfei
최종 변경:
mrenty,