jquery class gets added on click and then removed code example
Example: jquery add remove class clicked element
$(function() {
$('img').click(function() {
$(this).toggleClass('active');
});
});
$(function() {
$('img').click(function() {
$(this).toggleClass('active');
});
});