jQuery Tutorial


jQuery Example


jQuery References


jQuery CSS css() Method Reference


  jQuery CSS method References


Uses

jQuery css() method set one or more style properties value into selected elements.


Syntax

$(selector).class(name,value)

jQuery css() effect supported following parameters.

ParameterDescription
namename is Required parameter. name define the css properties.
valuevalue is required parameter. value define specific value assing the name.

jQuery CSS css() method Example

<script type="text/javascript"> 
$(document).ready(function(){
  $("button").click(function(){
    $("p").css("background-color","pink");
  });
});
<script>
Online Try This Code Your Self....   »

Syntax (Mutiple CSS Properties use)

$(selector).css({property:value,property:value, ...})

jQuery css() method Example (Mutiple CSS Properties use)

<script type="text/javascript"> 
$(document).ready(function(){
  $("button").click(function(){
    $("p").css({"background-color":"pink","font-size":"20px"});
  });
});
<script>
Online Try This Code Your Self....   »

  jQuery CSS method References