jQuery Tutorial


jQuery Example


jQuery References


jQuery HTML addClass() Method Reference


  All jQuery with HTML Method References


Uses

jQuery addClass() method Add one or more CSS class to selected elements.


Syntax

$(selector).addClass(classname)

jQuery addClass() method supported following parameters.

ParameterDescription
classnameclassname is Required parameter. add one or more css class names.

jQuery addClass() Method Example

<script type="text/javascript"> 
$(document).ready(function(){
  $("button").click(function(){
    $("p").addClass("param");
  });
});
</script>
Online Try This Code Your Self....   »

  All jQuery with HTML Method References