jQuery Tutorial


jQuery Example


jQuery References


jQuery HTML toggleClass() Method Reference


  All jQuery with HTML Method References


Uses

jQuery toggleClass() method Toggles add or remove one or more class from selected elements.


Syntax

$(selector).toggleClass(classname)

jQuery toggleClass() method supported following parameters.

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

jQuery toggleClass() Method Example

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

  All jQuery with HTML Method References