Get all the attributes of an element as an object