The Element.attributes property returns a live collection of all attribute nodes registered to the specified node.
Element.attributes
MDN Reference