Remove child class from active div

This question already has an answer here:

  • How can I select an element with multiple classes in jQuery? 10 answers

  • the removeClass accepts more then one class to remove:

     $('.thumb.thumb-selected > img.img-thumb').removeClass('BWFilter BWfade');
    

    The > - selector will only match when the img is a direct child of your div.

    Reference

    .removeClass()

    css - child-selector


    Consider this jquery line:

    $('.thumb.thumb-selected').find('img.img-thumb').removeClass("BWFilter BWfade");
    

    DEMO

    Removed space from $('.thumb .thumb-selected') .

    Reference: How can I select an element with multiple classes?


    尝试这个

    $('.thumb-selected').find('.BWFilter').removeClass("BWFilter").removeClass("BWfade");
    
    链接地址: http://www.djcxy.com/p/83090.html

    上一篇: 我如何选择一个CSS中有多个类的元素?

    下一篇: 从活动div中移除子类