How to remove class from all elements jquery

后端 未结 6 1247
野性不改
野性不改 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:43

    The best to remove a class in jquery from all the elements is to target via element tag. e.g.,

    $("div").removeClass("highlight");
    

提交回复
热议问题