diff options
Diffstat (limited to 'files/it/web/api/node/nextsibling/index.html')
| -rw-r--r-- | files/it/web/api/node/nextsibling/index.html | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/files/it/web/api/node/nextsibling/index.html b/files/it/web/api/node/nextsibling/index.html deleted file mode 100644 index f2355a6402..0000000000 --- a/files/it/web/api/node/nextsibling/index.html +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: Node.nextSibling -slug: Web/API/Node/nextSibling -translation_of: Web/API/Node/nextSibling ---- -<div>{{APIRef("DOM")}}</div> - -<p><span class="seoSummary">La proprietà di sola lettura <code><strong>Node.nextSibling</strong></code> restituisce il nodo immediatamente successivo a quello specificato nei {{domxref("Node.childNodes","childNodes")}}, del loro genitore o restituisce <code>null</code> se il nodo specificato è l'ultimo figlio nell'elemento genitore.</span></p> - -<h2 id="Sintassi">Sintassi</h2> - -<pre class="syntaxbox"><var>nextNode</var> = <var>node</var>.nextSibling -</pre> - -<h2 id="Appunti">Appunti</h2> - -<div> -<p>I browser basati su Gecko inseriscono nodi di testo in un documento per rappresentare gli spazi bianchi nel codice sorgente. Pertanto, un nodo ottenuto, ad esempio, utilizzando <a href="/it/docs/Web/API/Node/firstChild" title="The Node.firstChild read-only property returns the node's first child in the tree, or null if the node has no children."><code>Node.firstChild</code></a> o <a href="/it/docs/Web/API/Node/previousSibling" title="The Node.previousSibling read-only property returns the node immediately preceding the specified one in its parent's childNodes list, or null if the specified node is the first in that list."><code>Node.previousSibling</code></a> può fare riferimento a un nodo di testo di spazi bianchi piuttosto che all'elemento effettivo che l'autore intendeva ottenere.</p> - -<p>Vedi <a href="/en-US/docs/Web/Guide/DOM/Whitespace_in_the_DOM">Whitespace in the DOM</a> e <a class="external" href="http://www.w3.org/DOM/faq.html#emptytext" rel="noopener">W3C DOM 3 FAQ: Why are some Text nodes empty?</a> per maggiori informazioni.</p> -</div> - -<p>{{domxref("Element.nextElementSibling")}} può essere usato per ottenere l'elemento successivo saltando eventuali nodi di spazi vuoti, altro testo tra elementi o commenti.</p> - -<h2 id="Esempio">Esempio</h2> - -<pre class="brush:html"><div id="div-1">Here is div-1</div> -<div id="div-2">Here is div-2</div> - -<script> -var el = document.getElementById('div-1').nextSibling, - i = 1; - -console.group('Siblings of div-1:'); - -while (el) { - console.log(i, '. ', el.nodeName); - el = el.nextSibling; - i++; -} - -console.groupEnd(); -</script> - -/************************************************** - The console displays the following: - - Siblings of div-1 - - 1. #text - 2. DIV - 3. #text - 4. SCRIPT - -**************************************************/ -</pre> - -<p>Nell'esempio precedente, i nodi, <code>#text</code> sono inseriti nel DOM in cui si verifica lo spazio bianco tra i tag (ad esempio dopo il tag di chiusura di un elemento e prima del tag di apertura del successivo).</p> - -<p>La possibile inclusione di nodi di testo deve essere consentita quando si attraversa il DOM utilizzando <code>nextSibling</code>. Vedi le risorse <a href="#Appunti">nella sezione Appunti</a>.</p> - -<h2 id="Specifiche">Specifiche</h2> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">Specifica</th> - <th scope="col">Stato</th> - <th scope="col">Commento</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-node-nextsibling', 'Node.nextSibling')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>Nessun cambiamento</td> - </tr> - <tr> - <td>{{SpecName('DOM2 Core', 'core.html#ID-6AC54C2F', 'Node.nextSibling')}}</td> - <td>{{Spec2('DOM2 Core')}}</td> - <td>Nessun cambiamento</td> - </tr> - <tr> - <td>{{SpecName('DOM1', 'level-one-core.html#attribute-nextSibling', 'Node.nextSibling')}}</td> - <td>{{Spec2('DOM1')}}</td> - <td>Definizione iniziale</td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilità_con_i_browser">Compatibilità con i browser</h2> - - - -<p>{{Compat("api.Node.nextSibling")}}</p> - -<h2 id="Vedi_anche">Vedi anche</h2> - -<ul> - <li>{{domxref("Element.nextElementSibling")}}</li> -</ul> |
