Name

Node.hasAttributes( ) — determine whether a node has attributes

Availability

DOM Level 2 Core

Synopsis

boolean hasAttributes(  );

Returns

true if this node has one or more attributes; false if it has none. Note that only Element nodes can have attributes.

Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.