diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index b9553d2069a80ec..7eeaeeb60bec623 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -7151,9 +7151,9 @@ /en-US/docs/Web/API/CharacterData.previousElementSibling /en-US/docs/Web/API/Element/previousElementSibling /en-US/docs/Web/API/CharacterData/nextElementSibling /en-US/docs/Web/API/Element/nextElementSibling /en-US/docs/Web/API/CharacterData/previousElementSibling /en-US/docs/Web/API/Element/previousElementSibling -/en-US/docs/Web/API/CharacterData/remove /en-US/docs/Web/API/ChildNode/remove /en-US/docs/Web/API/ChildNode.nextElementSibling /en-US/docs/Web/API/Element/nextElementSibling -/en-US/docs/Web/API/ChildNode.remove /en-US/docs/Web/API/ChildNode/remove +/en-US/docs/Web/API/ChildNode.remove /en-US/docs/Web/API/Element/remove +/en-US/docs/Web/API/ChildNode/remove /en-US/docs/Web/API/Element/remove /en-US/docs/Web/API/Childnode.previousElementSibling /en-US/docs/Web/API/Element/previousElementSibling /en-US/docs/Web/API/Client/focus /en-US/docs/Web/API/WindowClient/focus /en-US/docs/Web/API/Client/focused /en-US/docs/Web/API/WindowClient/focused @@ -7344,7 +7344,6 @@ /en-US/docs/Web/API/DocumentTouch.createTouchList /en-US/docs/Web/API/Document/createTouchList /en-US/docs/Web/API/DocumentTouch/createTouch /en-US/docs/Web/API/Document/createTouch /en-US/docs/Web/API/DocumentTouch/createTouchList /en-US/docs/Web/API/Document/createTouchList -/en-US/docs/Web/API/DocumentType/remove /en-US/docs/Web/API/ChildNode/remove /en-US/docs/Web/API/Document_Object_Model/Events /en-US/docs/Learn/JavaScript/Building_blocks/Events /en-US/docs/Web/API/Document_Object_Model/Preface /en-US/docs/Web/API/Document_Object_Model /en-US/docs/Web/API/Document_Object_Model/Whitespace_in_the_DOM /en-US/docs/Web/API/Document_Object_Model/Whitespace @@ -7412,7 +7411,6 @@ /en-US/docs/Web/API/Element/pointerout_event /en-US/docs/Web/API/HTMLElement/pointerout_event /en-US/docs/Web/API/Element/pointerover_event /en-US/docs/Web/API/HTMLElement/pointerover_event /en-US/docs/Web/API/Element/pointerup_event /en-US/docs/Web/API/HTMLElement/pointerup_event -/en-US/docs/Web/API/Element/remove /en-US/docs/Web/API/ChildNode/remove /en-US/docs/Web/API/Element/resourcetimingbufferfull_event /en-US/docs/Web/API/Performance/resourcetimingbufferfull_event /en-US/docs/Web/API/ElementTraversal.childElementCount /en-US/docs/Web/API/Element/childElementCount /en-US/docs/Web/API/ElementTraversal.firstElementChild /en-US/docs/Web/API/Element/firstElementChild diff --git a/files/en-us/_wikihistory.json b/files/en-us/_wikihistory.json index 05139276cf461a8..3da39bddb62df20 100644 --- a/files/en-us/_wikihistory.json +++ b/files/en-us/_wikihistory.json @@ -34351,42 +34351,6 @@ "jpmedley" ] }, - "Web/API/ChildNode/remove": { - "modified": "2020-10-15T21:24:21.823Z", - "contributors": [ - "jm5764946", - "hcoronado", - "stevenvachon", - "mauskin", - "joedf", - "HawkeyePierce89", - "mfuji09", - "mfluehr", - "fscholz", - "erikadoyle", - "Tobie", - "chrisdavidmills", - "jacott", - "DomenicDenicola", - "stevenwdv", - "jszhou", - "arronei", - "jpmedley", - "theotherdell", - "huupoke12", - "jkbockstael", - "pepri", - "valtlait1", - "cvrebert", - "shgysk8zer0", - "paul.irish", - "teoli", - "ziyunfei", - "jyasskin", - "elisee", - "tregagnon" - ] - }, "Web/API/ChildNode/replaceWith": { "modified": "2020-10-15T21:47:15.895Z", "contributors": [ @@ -44209,6 +44173,42 @@ "AFBarstow" ] }, + "Web/API/Element/remove": { + "modified": "2020-10-15T21:24:21.823Z", + "contributors": [ + "jm5764946", + "hcoronado", + "stevenvachon", + "mauskin", + "joedf", + "HawkeyePierce89", + "mfuji09", + "mfluehr", + "fscholz", + "erikadoyle", + "Tobie", + "chrisdavidmills", + "jacott", + "DomenicDenicola", + "stevenwdv", + "jszhou", + "arronei", + "jpmedley", + "theotherdell", + "huupoke12", + "jkbockstael", + "pepri", + "valtlait1", + "cvrebert", + "shgysk8zer0", + "paul.irish", + "teoli", + "ziyunfei", + "jyasskin", + "elisee", + "tregagnon" + ] + }, "Web/API/Element/removeAttribute": { "modified": "2020-10-15T21:14:33.422Z", "contributors": [ diff --git a/files/en-us/learn/javascript/client-side_web_apis/manipulating_documents/index.html b/files/en-us/learn/javascript/client-side_web_apis/manipulating_documents/index.html index 41b3c3f8368dbff..468bbfb6099ad3d 100644 --- a/files/en-us/learn/javascript/client-side_web_apis/manipulating_documents/index.html +++ b/files/en-us/learn/javascript/client-side_web_apis/manipulating_documents/index.html @@ -161,7 +161,7 @@

Moving and removing elements

sect.removeChild(linkPara);
-

When you want to remove a node based only on a reference to itself, which is fairly common, you can use {{domxref("ChildNode.remove()")}}:

+

When you want to remove a node based only on a reference to itself, which is fairly common, you can use {{domxref("Element.remove()")}}:

linkPara.remove();
diff --git a/files/en-us/web/api/characterdata/index.html b/files/en-us/web/api/characterdata/index.html index 7cad2d9293b7de6..58720d8fc701eb7 100644 --- a/files/en-us/web/api/characterdata/index.html +++ b/files/en-us/web/api/characterdata/index.html @@ -39,7 +39,7 @@

Methods

Removes the specified amount of characters, starting at the specified offset, from the CharacterData.data string; when this method returns, data contains the shortened {{domxref("DOMString")}}.
{{domxref("CharacterData.insertData()")}}
Inserts the specified characters, at the specified offset, in the CharacterData.data string; when this method returns, data contains the modified {{domxref("DOMString")}}.
-
{{domxref("ChildNode.remove()")}} {{experimental_inline}}
+
{{domxref("CharacterData.remove()")}}
Removes the object from its parent children list.
{{domxref("CharacterData.replaceData()")}}
Replaces the specified amount of characters, starting at the specified offset, with the specified {{domxref("DOMString")}}; when this method returns, data contains the modified {{domxref("DOMString")}}.
diff --git a/files/en-us/web/api/characterdata/remove/index.html b/files/en-us/web/api/characterdata/remove/index.html new file mode 100644 index 000000000000000..90d024b8fba4661 --- /dev/null +++ b/files/en-us/web/api/characterdata/remove/index.html @@ -0,0 +1,57 @@ +--- +title: CharacterData.remove() +slug: Web/API/CharacterData/remove +tags: + - API + - CharacterData + - DOM + - Method +--- +
{{APIRef("DOM")}}
+ +

The CharacterData.remove() method removes text.

+ +

Syntax

+ +
remove()
+ +

Examples

+ +

Using remove()

+ +
+<p id="myText">Some text</p>
+
+ +
let text = document.getElementById('myText').firstChild;
+text.remove(); // Removes the text
+
+ +
+<p id="myText"></p>
+
+ +

Specifications

+ + + + + + + + + + + + +
Specification
{{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}}
+ +

Browser compatibility

+ +

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

+ +

See also

+ + diff --git a/files/en-us/web/api/documenttype/index.html b/files/en-us/web/api/documenttype/index.html index e87e47707bfccbc..b7790478bfaa486 100644 --- a/files/en-us/web/api/documenttype/index.html +++ b/files/en-us/web/api/documenttype/index.html @@ -34,10 +34,10 @@

Properties

Methods

-

Inherits methods from its parent, {{domxref("Node")}}, and implements the {{domxref("ChildNode")}} interface.

+

Inherits methods from its parent, {{domxref("Node")}}.

-
{{domxref("ChildNode.remove()")}} {{experimental_inline}}
+
{{domxref("DocumentType.remove()")}}
Removes the object from its parent children list.
diff --git a/files/en-us/web/api/documenttype/remove/index.html b/files/en-us/web/api/documenttype/remove/index.html new file mode 100644 index 000000000000000..7c1ce73d1742934 --- /dev/null +++ b/files/en-us/web/api/documenttype/remove/index.html @@ -0,0 +1,61 @@ +--- +title: DocumentType.remove() +slug: Web/API/DocumentType/remove +tags: + - API + - DocumentType + - DOM + - Method +--- +
{{APIRef("DOM")}}
+ +

The DocumentType.remove() method removes a document's doctype.

+ +
+

Note

+

Removing the document's doctype will set the rendering mode to + quirks mode! + Please don’t do this. Willfully designing for quirks mode is not going to help you. + If you need to work around issues with old Internet Explorer browsers, you might want to look into using + conditional comments, or other workarounds.

+
+ +

Syntax

+ +
remove()
+ +

Examples

+ +

Using remove()

+ +
+document.doctype; // "<!DOCTYPE html>'
+document.doctype.remove();
+document.doctype; // null
+
+ + +

Specifications

+ + + + + + + + + + + + +
Specification
{{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}}
+ +

Browser compatibility

+ +

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

+ +

See also

+ + diff --git a/files/en-us/web/api/element/index.html b/files/en-us/web/api/element/index.html index 5f15487b5b6f806..ce60f43914f5658 100644 --- a/files/en-us/web/api/element/index.html +++ b/files/en-us/web/api/element/index.html @@ -256,7 +256,7 @@

Methods

Returns a {{DOMxRef("NodeList")}} of nodes which match the specified selector string relative to the element.
{{DOMxRef("Element.releasePointerCapture()")}}
Releases (stops) pointer capture that was previously set for a specific {{DOMxRef("PointerEvent","pointer event")}}.
-
{{DOMxRef("ChildNode.remove()")}} {{Experimental_Inline}}
+
{{DOMxRef("Element.remove()")}}
Removes the element from the children list of its parent.
{{DOMxRef("Element.removeAttribute()")}}
Removes the named attribute from the current node.
diff --git a/files/en-us/web/api/childnode/remove/index.html b/files/en-us/web/api/element/remove/index.html similarity index 60% rename from files/en-us/web/api/childnode/remove/index.html rename to files/en-us/web/api/element/remove/index.html index 0f846fb0b5e44aa..64d76a09f2d2ce6 100644 --- a/files/en-us/web/api/childnode/remove/index.html +++ b/files/en-us/web/api/element/remove/index.html @@ -1,23 +1,22 @@ --- -title: ChildNode.remove() -slug: Web/API/ChildNode/remove +title: Element.remove() +slug: Web/API/Element/remove tags: -- API -- ChildNode -- DOM -- Method + - API + - Element + - DOM + - Method ---
{{APIRef("DOM")}}
-

The ChildNode.remove() method removes the object from the +

The Element.remove() method removes the element from the tree it belongs to.

Syntax

-
node.remove();
-
+
remove()
-

Example

+

Examples

Using remove()

@@ -30,7 +29,7 @@

Using remove()

el.remove(); // Removes the div with the 'div-02' id -

ChildNode.remove() is unscopable

+

Element.remove() is unscopable

The remove() method is not scoped into the with statement. See {{jsxref("Symbol.unscopables")}} for more information.

@@ -46,31 +45,21 @@

Specifications

Specification - Status - Comment {{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}} - {{Spec2('DOM WHATWG')}} - Initial definition.

Browser compatibility

-

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

+

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

See also

diff --git a/files/en-us/web/api/htmlselectelement/remove/index.html b/files/en-us/web/api/htmlselectelement/remove/index.html index 52e97b4ef8151fb..bf46b2b4388919e 100644 --- a/files/en-us/web/api/htmlselectelement/remove/index.html +++ b/files/en-us/web/api/htmlselectelement/remove/index.html @@ -97,7 +97,7 @@

Browser compatibility

See also

diff --git a/files/en-us/web/api/node/removechild/index.html b/files/en-us/web/api/node/removechild/index.html index f23143d38aec548..d5dfa28ed4eef97 100644 --- a/files/en-us/web/api/node/removechild/index.html +++ b/files/en-us/web/api/node/removechild/index.html @@ -168,6 +168,6 @@

See also