jQuery change the CSS property by using the css() method. The css() method needs two arguments you have to pass the function.

You can change any CSS properties of HTML element using the css().

How jQuery Change CSS Property: Single

Syntax: Change Single CSS Property

The selector parameter requires ids or class names of the HTML element you want to change CSS. There are two arguments passed inside the css(). The first parameter requires the property name and the second parameter required value of the relevant property.

See the example below to change single CSS property.

Output


This is the paragraph to change CSS Property.

How jQuery Change CSS Property: Multiple

Syntax: Change Multiple CSS Property

To change multiple CSS properties you can specify multiple property names with values inside the CSS function with curly bracket.

See the example below to change multiple CSS properties.

Output


This is the paragraph to change CSS Property.

If you want to learn more about css method you have to check jQuery CSS method page.

Resource
jQuery css() API

Leave a Reply

Your email address will not be published. Required fields are marked *