jquery syntax to add and remove class on click element 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')
});