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/es/web/api/childnode/remove/index.html | 94 ---------------------------- 1 file changed, 94 deletions(-) delete mode 100644 files/es/web/api/childnode/remove/index.html (limited to 'files/es/web') diff --git a/files/es/web/api/childnode/remove/index.html b/files/es/web/api/childnode/remove/index.html deleted file mode 100644 index 90aab3d869..0000000000 --- a/files/es/web/api/childnode/remove/index.html +++ /dev/null @@ -1,94 +0,0 @@ ---- -title: ChildNode.remove() -slug: Web/API/ChildNode/remove -tags: - - API - - ChildNode - - DOM - - Experimental - - metodo -translation_of: Web/API/ChildNode/remove ---- -

{{APIRef ( "DOM")}}
- El método ChildNode.remove ( ) elimina el objeto del árbol al que pertenece.

- -

Sintaxis

- -
node.remove();
-
- -

Ejemplo

- -

Utilizando remove()

- -
<div id="div-01">Este es el div-01</div>
-<div id="div-02">Este es el div-02</div>
-<div id="div-03">Este es el div-03</div>
-
- -
var el = document.getElementById('div-02');
-el.nextElementSibling.remove(); // Elimina el div con el id 'div-03'
-
- -

ChildNode.remove() es unscopable

- -

El método remove() no está definido en el contexto de las declaración with. Consulte {{jsxref ("Symbol.unscopables")}} para obtener más información.

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

Polyfill

- -

El código a continuación es un polyfill del método remove() para Internet Explorer 9 y superiores:

- -
// 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]);
- -

Especificaciones

- - - - - - - - - - - - - - -
EspecificaciónEstadoComentario
{{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}}{{Spec2('DOM WHATWG')}}Definición inicial.
- -

Compatibilidad en los navegadores

- -
-

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

-
- -

Ver también

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