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 @@
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 @@
CharacterData.data
string; when this method returns, data
contains the shortened {{domxref("DOMString")}}.CharacterData.data
string; when this method returns, data
contains the modified {{domxref("DOMString")}}.data
contains the modified {{domxref("DOMString")}}.The CharacterData.remove()
method removes text.
remove()+ +
remove()
+<p id="myText">Some text</p> ++ +
let text = document.getElementById('myText').firstChild; +text.remove(); // Removes the text ++ +
+<p id="myText"></p> ++ +
Specification | +
---|
{{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}} | +
{{Compat("api.CharacterData.remove")}}
+ +Inherits methods from its parent, {{domxref("Node")}}, and implements the {{domxref("ChildNode")}} interface.
+Inherits methods from its parent, {{domxref("Node")}}.
The DocumentType.remove()
method removes a document's doctype
.
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.
+remove()+ +
remove()
+document.doctype; // "<!DOCTYPE html>' +document.doctype.remove(); +document.doctype; // null ++ + +
Specification | +
---|
{{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}} | +
{{Compat("api.DocumentType.remove")}}
+ +The ChildNode.remove()
method removes the object from the
+
The Element.remove()
method removes the element from the
tree it belongs to.
node.remove(); -+
remove()-
remove()
remove()
ChildNode.remove()
is unscopableElement.remove()
is unscopableThe remove()
method is not scoped into the with
statement.
See {{jsxref("Symbol.unscopables")}} for more information.
{{Compat("api.ChildNode.remove")}}
+{{Compat("api.Element.remove")}}