Answers for "how to addclass and remove class in click in jquery in w3s"

1

jquery add remove class clicked element

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

body click function removeclass

$(document).ready(function () {
            $('.div, section').click(function () {
                $('.sopping-box').addClass('sopping-box');
                $('.sopping-box').removeClass('sopping-box-collapse');
            });
        });
Posted by: Guest on December-26-2021

Code answers related to "how to addclass and remove class in click in jquery in w3s"

Code answers related to "Javascript"

Browse Popular Code Answers by Language