Your answer to paragraph a is on the same page that you linked to:
Using CSS classes to style
As a getter, the .css () method is valuable. However, it should generally be avoided as a setter in production-ready code, because in general, it is best to save presentation information from JavaScript code. Instead, write CSS rules for classes that describe various visual states, and then change the class to an element.
source share