diff options
Diffstat (limited to 'files/it/web/api/element/hasattribute/index.html')
| -rw-r--r-- | files/it/web/api/element/hasattribute/index.html | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/files/it/web/api/element/hasattribute/index.html b/files/it/web/api/element/hasattribute/index.html deleted file mode 100644 index 4cd6d2a9d2..0000000000 --- a/files/it/web/api/element/hasattribute/index.html +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Element.hasAttribute() -slug: Web/API/Element/hasAttribute -translation_of: Web/API/Element/hasAttribute ---- -<div>{{APIRef("DOM")}}</div> - -<p>Il metodo <strong><code>Element.hasAttribute()</code></strong> restituisce un valore <strong>booleano</strong> che indica se l'elemento specificato ha o meno l'attributo specificato.</p> - -<h2 id="Sintassi">Sintassi</h2> - -<pre class="syntaxbox"><var>var <em>risultato</em></var> = <em><var>element</var></em>.hasAttribute(<em><var>name</var></em>); -</pre> - -<dl> - <dt><code>risultato</code></dt> - <dd>detiene il valore di ritorno <code>true</code> o <code>false</code>.</dd> - <dt><code>name</code></dt> - <dd>è una stringa che rappresenta il nome dell'attributo.</dd> -</dl> - -<h2 id="Esempio">Esempio</h2> - -<pre class="brush:js">var foo = document.getElementById("foo"); -if (foo.hasAttribute("bar")) { - // fare qualcosa -} -</pre> - -<h2 id="Polyfill">Polyfill</h2> - -<pre class="brush:js">;(function(prototype) { - prototype.hasAttribute = prototype.hasAttribute || function(name) { - return !!(this.attributes[name] && - this.attributes[name].specified); - } -})(Element.prototype); -</pre> - -<h2 id="Appunti">Appunti</h2> - -<div>{{DOMAttributeMethods}}</div> - -<h2 id="Specifiche">Specifiche</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specifica</th> - <th scope="col">Stato</th> - <th scope="col">Commento</th> - </tr> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-element-hasattribute', 'Element.hasAttribute()')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>Da {{SpecName('DOM3 Core')}}, spostato da {{domxref("Node")}} a {{domxref("Element")}}</td> - </tr> - <tr> - <td>{{SpecName('DOM3 Core', 'core.html#ID-ElHasAttr', 'Element.hasAttribute()')}}</td> - <td>{{Spec2('DOM3 Core')}}</td> - <td>Nessun cambiamento da {{SpecName('DOM2 Core')}}</td> - </tr> - <tr> - <td>{{SpecName('DOM2 Core', 'core.html#ID-ElHasAttr', 'Element.hasAttribute()')}}</td> - <td>{{Spec2('DOM2 Core')}}</td> - <td>Definizione iniziale.</td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilità_con_i_browser">Compatibilità con i browser</h2> - - - -<p>{{Compat("api.Element.hasAttribute")}}</p> |
