From 156b518735b8da6cc954105b0a1250ca31449381 Mon Sep 17 00:00:00 2001 From: MDN Date: Sat, 22 May 2021 00:42:07 +0000 Subject: [CRON] sync translated content --- files/ko/web/api/childnode/remove/index.html | 97 ---------------------------- 1 file changed, 97 deletions(-) delete mode 100644 files/ko/web/api/childnode/remove/index.html (limited to 'files/ko/web/api') diff --git a/files/ko/web/api/childnode/remove/index.html b/files/ko/web/api/childnode/remove/index.html deleted file mode 100644 index 2c4992989f..0000000000 --- a/files/ko/web/api/childnode/remove/index.html +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: ChildNode.remove() -slug: Web/API/ChildNode/remove -tags: - - API - - ChildNode - - DOM - - 메소드 - - 실험중 -translation_of: Web/API/ChildNode/remove ---- -
{{APIRef("DOM")}}
- -

ChildNode.remove() 메소드는 이를 포함하는 트리로부터 객체를 제거합니다.

- -

문법

- -
node.remove();
-
- -

예제

- -

remove() 사용하기

- -
<div id="div-01">div-01 입니다</div>
-<div id="div-02">div-02 입니다</div>
-<div id="div-03">div-03 입니다</div>
-
- -
var el = document.getElementById('div-02');
-el.remove(); // id가 'div-02' 인 div를 제거합니다
-
- -

ChildNode.remove() 는 스코프 지정 불가

- -

remove() 메소드는 with 구문으로 스코프를 지정할 수 없습니다. 자세한 내용은 {{jsxref("Symbol.unscopables")}} 을 확인하세요.

- -
with(node) {
-  remove();
-}
-// ReferenceError: remove is not defined 
- -

폴리필

- -

인터넷 익스플로러 9 이상에서는 다음 코드를 사용해 remove() 메소드 를 폴리필링할 수 있습니다.

- -
// from:https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md
-(function (arr) {
-  arr.forEach(function (item) {
-    if (item.hasOwnProperty('remove')) {
-      return;
-    }
-    Object.defineProperty(item, 'remove', {
-      configurable: true,
-      enumerable: true,
-      writable: true,
-      value: function remove() {
-        if (this.parentNode !== null)
-          this.parentNode.removeChild(this);
-      }
-    });
-  });
-})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
- -

명세

- - - - - - - - - - - - - - -
명세상태코멘트
{{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}}{{Spec2('DOM WHATWG')}}초기 정의.
- -

브라우저 호환성

- -
- - -

{{Compat("api.ChildNode.remove")}}

-
- -

함께 보기

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