Get or Set CSS Style Properties .css()

This jQuery function gets a CSS property of the first matched element or sets CSS properties for all matching elements. For example to set the background color for all elements of type <div> use $('div').css('background-color','#ff6600')


e.g. $("div").css("background-color","#FF6600")

.css(propertyName) will return the value of CSS property propertyName. or set the value of propertyName by passing the value of CSS property

Example 1: $("div").hasClass("someClass") returns true if at least one <div> has someClass assigned to its class attribute.
// will return true 
<div class="someClass">A</div> // div has someClass
jQuery manipulation style .css()