Description:

Jquery .css() method Get/set the css property for the matched elements.

Syntax

GETย Property: .css( propertyName )
SET Property: .css( propertyName, value )

propertyNameย  A css property name
value A value to set for the property

Note :

To set multiple value, the syntax will be

.css({“propertyname”:”value”,”propertyname”:”value”,…});

GETย CSS Property value :

It will return the value for specified CSS property value for the matched element

Example:ย 

Output:

jquery-css-method-dotnet-helpers-com-thiyagu

SETย CSS Property :

It will set CSS property for the matched element.

 

Output:

Clicking the button, the background-color porperty will setย to the div(divBlogName) as shown below.

dotnet-helpers-jquery-css-method-thiyagu