aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/orphaned
diff options
context:
space:
mode:
authorMDN <actions@users.noreply.github.com>2021-05-22 00:42:07 +0000
committerMDN <actions@users.noreply.github.com>2021-05-22 00:42:07 +0000
commit156b518735b8da6cc954105b0a1250ca31449381 (patch)
tree6a0e35a9622dc00acfc816503410e9a4cd360bc4 /files/pt-br/orphaned
parent73aff5bd1edf14df05228693ed569b652ce89eee (diff)
downloadtranslated-content-156b518735b8da6cc954105b0a1250ca31449381.tar.gz
translated-content-156b518735b8da6cc954105b0a1250ca31449381.tar.bz2
translated-content-156b518735b8da6cc954105b0a1250ca31449381.zip
[CRON] sync translated content
Diffstat (limited to 'files/pt-br/orphaned')
-rw-r--r--files/pt-br/orphaned/web/api/childnode/remove/index.html101
1 files changed, 101 insertions, 0 deletions
diff --git a/files/pt-br/orphaned/web/api/childnode/remove/index.html b/files/pt-br/orphaned/web/api/childnode/remove/index.html
new file mode 100644
index 0000000000..57dcc06698
--- /dev/null
+++ b/files/pt-br/orphaned/web/api/childnode/remove/index.html
@@ -0,0 +1,101 @@
+---
+title: ChildNode.remove()
+slug: orphaned/Web/API/ChildNode/remove
+tags:
+ - API
+ - ChildNode
+ - DOM
+ - Experimental
+ - Método(2)
+ - remove
+translation_of: Web/API/ChildNode/remove
+original_slug: Web/API/ChildNode/remove
+---
+<div>{{APIRef("DOM")}}</div>
+
+<p>O método <code><strong>ChildNode.remove()</strong></code> remove o objeto da árvore a que ele pertence.</p>
+
+<h2 id="Sintase">Sintase</h2>
+
+<pre class="syntaxbox"><em>elementNodeReference</em>.remove();
+</pre>
+
+<h2 id="Exemplo">Exemplo</h2>
+
+<h3 id="Usando_remove()">Usando <code>remove()</code></h3>
+
+<pre class="brush: html">&lt;div id="div-01"&gt;Here is div-01&lt;/div&gt;
+&lt;div id="div-02"&gt;Here is div-02&lt;/div&gt;
+&lt;div id="div-03"&gt;Here is div-03&lt;/div&gt;
+</pre>
+
+<pre class="brush: js">var el = document.getElementById('div-01');
+el.nextElementSibling.remove(); // Remove o div com o id 'div-02'
+</pre>
+
+<h3 id="ChildNode.remove()_não_tem_escopo"><code>ChildNode.remove()</code> não tem escopo</h3>
+
+<p>O método <code>remove()</code> não tem escopo na função <code>with</code>. Veja {{jsxref("Symbol.unscopables")}} para mais informação.</p>
+
+<pre class="brush: js">with(node) {
+ remove();
+}
+// ReferenceError: remove is not defined </pre>
+
+<h2 id="Polyfill">Polyfill</h2>
+
+<p>Você pode evitar incompatibilidade ao usar o método <code>remove() no</code> Internet Explorer 9 em diante com o seguinte código:</p>
+
+<pre class="brush: js">// de: 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() {
+ this.parentNode.removeChild(this);
+ }
+ });
+ });
+})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);</pre>
+
+<h2 id="Especificações">Especificações</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Especificação</th>
+ <th scope="col">Situação</th>
+ <th scope="col">Comentário</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}}</td>
+ <td>{{Spec2('DOM WHATWG')}}</td>
+ <td>Definição Inicial.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM4', '#dom-childnode-remove', 'ChildNode.remove')}}</td>
+ <td>{{Spec2('DOM4')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilidade_de_navegadores">Compatibilidade de navegadores</h2>
+
+<div>{{Compat("api.ChildNode.remove")}}</div>
+
+<p> </p>
+
+<h2 id="Veja_também">Veja também</h2>
+
+<ul>
+ <li>A interface pura {{domxref("ChildNode")}}.</li>
+ <li>
+ <div class="syntaxbox">Tipos de objeto implementando esta interface pura: {{domxref("CharacterData")}}, {{domxref("Element")}}, e {{domxref("DocumentType")}}.</div>
+ </li>
+</ul>