jQuery css() Method
jQuery css() Method
The css() method is used to set or return one or more style properties for the selected elements.
Syntax:-
- Syntax for returning value of CSS property is:- $(selector).css(property)
- Syntax for setting value of CSS property is:- $(selector).css(property,value)
- Syntax for settings multiple properties and values is:- $(selector).css({property:value, property:value, ...})
- Sntax for setting property and value with function is:- $(selector).css(property,function(index,currentvalue))
Further Explanation:-
Parameter | Description |
---|---|
property | Specifies the CSS property name. |
value | Specifies the value of the CSS property. |
function(index,currentvalue) | Specifies a function that returns the new value for the CSS property
|
Code Explanation
All Tutorials related to jQuery CSS and HTML Methods
addClass() Method in jQuery
after() Method in jQuery
append() Method in jQuery
appendTo() Method in jQuery
attr() Method in jQuery
before() Method in jQuery
clone() Method in jQuery
css() Method in jQuery
detach() Method in jQuery
empty() Method in jQuery
hasClass() Method in jQuery
height() Method in jQuery
html() Method in jQuery
innerHeight() Method in jQuery
innerWidth() Method in jQuery
insertAfter() Method in jQuery
insertBefore() Method in jQuery
offset() Method in jQuery
offsetParent() Method in jQuery
outerHeight() Method in jQuery
outerWidth() Method in jQuery
position() Method in jQuery
prepend() Method in jQuery
prependTo() Method in jQuery
prop() Method in jQuery
remove() Method in jQuery
removeAttr() Method in jQuery
removeClass() Method in jQuery
removeProp() Method in jQuery
replaceAll() Method in jQuery
replaceWith() Method in jQuery
scrollLeft() Method in jQuery
scrollTop() Method in jQuery
text() Method in jQuery
toggleClass() Method in jQuery
unwrap() Method in jQuery
val() Method in jQuery
width() Method in jQuery
wrap() Method in jQuery
wrapAll() Method in jQuery
wrapInner() Method in jQuery