aboutsummaryrefslogtreecommitdiff
path: root/files/it/web/api/selection/addrange/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/it/web/api/selection/addrange/index.html')
-rw-r--r--files/it/web/api/selection/addrange/index.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/files/it/web/api/selection/addrange/index.html b/files/it/web/api/selection/addrange/index.html
new file mode 100644
index 0000000000..cff46a4d65
--- /dev/null
+++ b/files/it/web/api/selection/addrange/index.html
@@ -0,0 +1,39 @@
+---
+title: addRange
+slug: Web/API/Selection/addRange
+tags:
+ - DOM
+ - Gecko
+ - Reference_del_DOM_di_Gecko
+ - Tutte_le_categorie
+translation_of: Web/API/Selection/addRange
+---
+<p>{{ ApiRef() }}</p>
+<h3 id="Sommario" name="Sommario">Sommario</h3>
+<p>Aggiunge un range alla selezione.</p>
+<h3 id="Sintassi" name="Sintassi">Sintassi</h3>
+<pre class="eval"><i>selezione</i>.addRange(<i>range</i>)
+</pre>
+<h3 id="Parametri" name="Parametri">Parametri</h3>
+<dl>
+ <dt>
+ <i>
+ <code>range</code></i>
+ </dt>
+ <dd>
+ Un oggetto <a href="it/DOM/range">range</a> che verrà aggiunto alla selezione.</dd>
+</dl>
+<h3 id="Esempio" name="Esempio">Esempio</h3>
+<pre class="eval"> /* seleziono tutti gli oggetti STRONG all'interno del documento HTML */
+ var strongs = document.getElementsByTagName("strong");
+ var s = window.getSelection();
+ if(s.rangeCount &gt; 0) s.removeAllRanges();
+ for(var i = 0; i &lt; strongs.length; i++) {
+ var range = document.createRange();
+ range.selectNode(strongs[i]);
+ s.addRange(range);
+ }
+</pre>
+<div class="noinclude">
+  </div>
+<p>{{ languages( { "es": "es/DOM/Selection/addRange", "it": "it/DOM/Selection/addRange", "pl": "pl/DOM/Selection/addRange" } ) }}</p>