How to remove class from all elements jquery

后端 未结 6 1266
野性不改
野性不改 2021-01-31 23:58

I am changing the class of an element with the following

  $(\"#\"+data.id).addClass(\"highlight\")

Given the list below.

 <         


        
6条回答
  •  情话喂你
    2021-02-01 00:38

    You need to select the li tags contained within the .edgetoedge class. .edgetoedge only matches the one ul tag:

    $(".edgetoedge li").removeClass("highlight");
    

提交回复
热议问题