jQuery Remove CSS Class from all Descendants at once

后端 未结 4 1115
花落未央
花落未央 2021-02-13 13:48

Can I remove a specific CSS class from all XYZ elements within an element at once?

Example: Remove CSS class active from all

4条回答
  •  無奈伤痛
    2021-02-13 14:32

    If search is a class:

    $("div.search a").removeClass("active");
    

    If search is an ID:

    $("#search a").removeClass("active");
    

提交回复
热议问题