English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
hasAttributes()L'attributo restituisce un valore booleano true o false per indicare se l'elemento nodo corrente ha almeno un attributo (attribute).
element.hasAttributes()
var p = document.getElementsByTagName("P")[0]; p.hasAttributes();Prova a vedere‹/›
Tutti i browser supportano completamente il metodo hasAttributes():
Metodo | |||||
hasAttributes() | Sì | Sì | Sì | Sì | Sì |
Valore di ritorno: | Valore booleano, se l'elemento ha qualsiasi attributo, restituisce true, altrimenti false |
---|---|
Versione DOM: | DOM 2° livello |
Tutorial HTML:Attributi HTML
Riferimento HTML DOM:Metodo hasAttribute()
Riferimento HTML DOM:Metodo getAttribute()
Riferimento HTML DOM:Metodo setAttribute()
Riferimento HTML DOM:Metodo removeAttribute()