Answers for "syntax to remove and add class from element when clicked using jquery"

1

jquery add remove class clicked element

$(function() {
    $('img').click(function() {
       $(this).toggleClass('active');
    });
});
Posted by: Guest on January-19-2021

Code answers related to "syntax to remove and add class from element when clicked using jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language