/

HTML / CSS / JavaScript Tutorial

JavaScript DOM HTML method: hasAttributes()

[this page | pdf | back links]

The hasAttributes() method (when applied to HTML elements in the JavaScript DOM) returns true if the element has an attributes, otherwise it returns false.

 

It has the following syntax with no parameters. It returns a Boolean as above. It can be applied to any node, but if the node is not an element then it will always return false.

 

element.hasAttributes()

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile