bapp08.indd 02/19/2015 Page 543
CSS
METHOD DESCRIPTION RETURN
VALUECSScss(property) Returns the specifi ed CSS property value from
the fi rst selected element—for example:
$('div').css('background-color')Stringcss(properties) Sets the specifi ed CSS properties. The
properties argument is defi ned as an object
literal of key, value pairs—for example:
$('div').css({
backgroundColor : 'red',
marginLeft : '10px'
});jQuerycss(property, value) Sets the specifi ed CSS property value—for
example:
$('div').css('background', 'red');jQueryCLASS NAMESaddClass() Adds the specifi ed class name(s) to the selected
element(s). Multiple class names are separated
by spaces.jQueryhasClass(className) Determines whether the selected element(s)
have the specifi ed class name. This method
does not support multiple class names at the
time of this writing.BooleanH
continues