hasAttributes

Returns true if element has attributes, and false otherwise.

MDN Reference