review attr() and css() logic