Skip to content
Wolfy87 edited this page Nov 23, 2010 · 2 revisions

$(string element, object context).css(object properties)

Parameters

element - The CSS selector string to your element.

context - If supplied, the context in which you wish the selection to take place.

properties - The CSS properties you wish to assign.

Return values

Returns all of the CSS properties of the element.

Examples

Set the color of all paragraph tags to red

$('p').css({color: '#FF0000'});

Get the color of the paragraph tags

alert($('p').css().color);