AJAX
Basics
Data
DOM
Effects
Events
Forms
jQuery UI
Plug Ins
Traversing
The following example will show how to use the toggleClass()
method.
This method toggles between adding/removing classes from the selected elements.
$("#btnDemo3").click(function () { $("#demo3").toggleClass("text-danger")});