jQuery css () method
jQuery css () method
css () method sets or returns one or more style attributes of the selected element.
Returns CSS property
To return the value of the specified CSS property, use the following syntax:
css("propertyname");
The following example will return the first matching element of the background-color value:
Set CSS properties
To set the specified CSS property, use the following syntax:
css("propertyname","value");
The following example will match all the elements set background-color value:
Set multiple CSS properties
To set multiple CSS attributes, use the following syntax:
css({"propertyname":"value","propertyname":"value",...});
The following example will match all the elements set background-color and font-size: