Easy Tutorial
❮ Dom Nodes Replace Met Element Hasattributens ❯

XML DOM hasAttributes() Method



Definition and Usage

The hasAttributes() method returns TRUE if the current element node has attributes, otherwise it returns FALSE.

Syntax


Example

The following code snippet uses loadXMLDoc() to load "books.xml" into xmlDoc and checks if the first <book> element has attributes:

Example

Output:


❮ Dom Nodes Replace Met Element Hasattributens ❯