on click add and remove class jquery code example
Example 1: jquery add remove class clicked element
$(function() {
$('img').click(function() {
$(this).toggleClass('active');
});
});
Example 2: add and remove class in jquery
$('#toggle li').on('click', function () {
$(this).toggleClass('open')
});