The first method in the classes and styles group is
.css(). This method is very powerful and shows why jQuery is a required and useful library even in the age of HTML5 browsers. The
.css() method operates as both a getter and a setter. As a getter, it returns the computed style property or properties. It takes as arguments either a single string that is the name of a CSS property you would like to retrieve or an array of strings representing all of the CSS properties:
// .css(), retrieving a single property var backgroundColor = $(".jumbotron > .container > p > a").css("background-color"); console.log("Background Color = " + JSON.stringify(backgroundColor)); // .css(), retrieving multiple properties in a single call var colors ...