Javascript: Get all attributes of an element