English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
hasAttributes()The attribute returns a boolean value true or false to indicate whether the current element node has at least one attribute (attribute).
element.hasAttributes()
var p = document.getElementsByTagName("P")[0]; p.hasAttributes();Test See‹/›
All browsers fully support the hasAttributes() method:
Method | |||||
hasAttributes() | Yes | Yes | Yes | Yes | Yes |
Return Value: | Boolean value, returns true if the element has any attributes, otherwise returns false |
---|---|
DOM Version: | DOM 2Level |
HTML Tutorial:HTML Attributes
HTML DOM Reference:hasAttribute() Method
HTML DOM Reference:getAttribute() Method
HTML DOM Reference:setAttribute() Method
HTML DOM Reference:removeAttribute() Method