modify .attr() to read the attributes if second parameter is not defined