TreeWalker.currentNode

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

TreeWalker.currentNode 속성은 TreeWalker가 현재 가리키고 있는 Node를 나타낸다.

구문

js
node = treeWalker.currentNode;
treeWalker.currentNode = node;

예제

js
var treeWalker = document.createTreeWalker(
  document.body,
  NodeFilter.SHOW_ELEMENT,
  {
    acceptNode: function (node) {
      return NodeFilter.FILTER_ACCEPT;
    },
  },
  false,
);
root = treeWalker.currentNode; // 첫번째 엘리먼트인 루트 엘리먼트!

명세

Specification
DOM
# ref-for-dom-treewalker-currentnode①

브라우저 호환성

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
currentNode

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

같이 보기