What if the element does not have the specified CSS property when applying .css()?

Question

In the context of this exercise, what if the element does not have the specified CSS property when applying .css() to it?

Answer

If the property specified in the .css() method is not already set, then it will add the property and value to the element. However, if the property already has been set for the element, then the .css() method will override the current value with the new value.

7 Likes