⊗jqBsCG 10 of 113 menu

Working with CSS via jQuery

To work with CSS, jQuery provides the css method. Its first parameter is the name of the CSS property, and the second is its new value.

Let's say we have the following code:

<p class="www">text</p>

Let's get all elements with class www and change their color to red:

$('.www').css('color', 'red');

All h3 make the text green.

Get and color red all elements with class zzz.

byenru