Get first and last class with jQuery

后端 未结 7 1305
一整个雨季
一整个雨季 2021-02-09 02:58

Might be a newbie question. I have a code line like this:

I need to get each class for itself.

7条回答
  •  北海茫月
    2021-02-09 03:45

    I think that this is the easy way.

    $(".element").last().addClass("highlight");
    

提交回复
热议问题