aboutsummaryrefslogtreecommitdiff
path: root/files/it/web/api/element/removeattribute/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/it/web/api/element/removeattribute/index.html')
-rw-r--r--files/it/web/api/element/removeattribute/index.html57
1 files changed, 57 insertions, 0 deletions
diff --git a/files/it/web/api/element/removeattribute/index.html b/files/it/web/api/element/removeattribute/index.html
new file mode 100644
index 0000000000..2a64205cc3
--- /dev/null
+++ b/files/it/web/api/element/removeattribute/index.html
@@ -0,0 +1,57 @@
+---
+title: Element.removeAttribute()
+slug: Web/API/Element/removeAttribute
+tags:
+ - API
+ - DOM
+ - Elemento
+ - Riferimento
+ - metodo
+translation_of: Web/API/Element/removeAttribute
+---
+<div>{{ APIRef("DOM") }}</div>
+
+<p><span class="seoSummary">Il metodo {{domxref("Element")}} <strong><code>removeAttribute()</code></strong> rimuove l'attributo con il nome specificato dall'elemento.</span></p>
+
+<h2 id="Sintassi">Sintassi</h2>
+
+<pre class="syntaxbox"><em>element</em>.removeAttribute(<em>attrName</em>);
+</pre>
+
+<h3 id="Parametri">Parametri</h3>
+
+<dl>
+ <dt><code>attrName</code></dt>
+ <dd>Una {{domxref("DOMString")}} che specifica il nome dell'attributo da rimuovere dall'elemento. Se l'attributo specificato non esiste, <code>removeAttribute()</code> restituisce senza generare un errore.</dd>
+</dl>
+
+<h3 id="Valore_di_ritorno">Valore di ritorno</h3>
+
+<p><code>undefined</code>.</p>
+
+<div class="note">
+<p><strong>Note:</strong> Poiché <code>removeAttribute()</code> non restituisce un valore, non è possibile concatenare più chiamate contemporaneamente per rimuovere più attributi contemporaneamente.</p>
+</div>
+
+<h2 id="Note_di_utilizzo">Note di utilizzo</h2>
+
+<p>Dovresti usare <code>removeAttribute()</code> <font><font>invece di impostare il valore dell'attributo </font></font><code>null</code> <font><font>direttamente o usando</font></font> {{domxref("Element.setAttribute", "setAttribute()")}}. Molti attributi non si comportano come previsto se li imposti a <code>null</code>.</p>
+
+<p>{{ DOMAttributeMethods() }}</p>
+
+<h2 id="Esempio">Esempio</h2>
+
+<pre class="brush: js">// Prima: &lt;div id="div1" align="left" width="200px"&gt;
+document.getElementById("div1").removeAttribute("align");
+// Dopo: &lt;div id="div1" width="200px"&gt;
+</pre>
+
+<h2 id="Specifica">Specifica</h2>
+
+<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-6D6AC0F9">DOM Level 2 Core: removeAttribute</a> (introdotta nel <a class="external" href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-removeAttribute">DOM Level 1 Core</a>)</p>
+
+<h2 id="Compatibilità_con_i_browser">Compatibilità con i browser</h2>
+
+
+
+<p>{{Compat("api.Element.removeAttribute")}}</p>