-
Notifications
You must be signed in to change notification settings - Fork 22.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Demix ChildNode.remove to Element, CharacterData, DocumentType (#5088)
* Demix ChildNode.remove to Element, CharacterData, DocumentType * Address feedback
- Loading branch information
Showing
11 changed files
with
174 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
title: CharacterData.remove() | ||
slug: Web/API/CharacterData/remove | ||
tags: | ||
- API | ||
- CharacterData | ||
- DOM | ||
- Method | ||
--- | ||
<div>{{APIRef("DOM")}}</div> | ||
|
||
<p>The <code><strong>CharacterData.remove()</strong></code> method removes text.</p> | ||
|
||
<h2 id="Syntax">Syntax</h2> | ||
|
||
<pre class="brush: js">remove()</pre> | ||
|
||
<h2 id="Examples">Examples</h2> | ||
|
||
<h3 id="Using_remove">Using <code>remove()</code></h3> | ||
|
||
<pre class="brush: html"> | ||
<p id="myText">Some text</p> | ||
</pre> | ||
|
||
<pre class="brush: js">let text = document.getElementById('myText').firstChild; | ||
text.remove(); // Removes the text | ||
</pre> | ||
|
||
<pre class="brush: html"> | ||
<p id="myText"></p> | ||
</pre> | ||
|
||
<h2 id="Specifications">Specifications</h2> | ||
|
||
<table class="standard-table"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Specification</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>{{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<h2 id="Browser_compatibility">Browser compatibility</h2> | ||
|
||
<p>{{Compat("api.CharacterData.remove")}}</p> | ||
|
||
<h2 id="See_also">See also</h2> | ||
|
||
<ul> | ||
<li>{{domxref("Element.remove()")}}</li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
title: DocumentType.remove() | ||
slug: Web/API/DocumentType/remove | ||
tags: | ||
- API | ||
- DocumentType | ||
- DOM | ||
- Method | ||
--- | ||
<div>{{APIRef("DOM")}}</div> | ||
|
||
<p>The <code><strong>DocumentType.remove()</strong></code> method removes a document's <code>doctype</code>.</p> | ||
|
||
<div class="note"> | ||
<h4>Note</h4> | ||
<p>Removing the document's doctype will set the rendering mode to | ||
<a href="/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode">quirks mode</a>! | ||
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 | ||
<a href="/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/HTML_and_CSS#ie_conditional_comments">conditional comments</a>, or other workarounds.</p> | ||
</div> | ||
|
||
<h2 id="Syntax">Syntax</h2> | ||
|
||
<pre class="brush: js">remove()</pre> | ||
|
||
<h2 id="Examples">Examples</h2> | ||
|
||
<h3 id="Using_remove">Using <code>remove()</code></h3> | ||
|
||
<pre class="brush: js"> | ||
document.doctype; // "<!DOCTYPE html>' | ||
document.doctype.remove(); | ||
document.doctype; // null | ||
</pre> | ||
|
||
|
||
<h2 id="Specifications">Specifications</h2> | ||
|
||
<table class="standard-table"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Specification</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>{{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<h2 id="Browser_compatibility">Browser compatibility</h2> | ||
|
||
<p>{{Compat("api.DocumentType.remove")}}</p> | ||
|
||
<h2 id="See_also">See also</h2> | ||
|
||
<ul> | ||
<li>{{domxref("Document.doctype")}}</li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters