Get an object of all attributes on a DOM element