toggle class on click fucntin jquery code example
Example 1: jquert toggleClass condition
// add class [class-name] if condition is true
// or else remove it
$('#foo-bar').toggleClass('class-name', condition)
Example 2: toggle class jquery
toggleClass