jquery find element by specific class when element has multiple classes

后端 未结 5 1177
Happy的楠姐
Happy的楠姐 2021-01-30 22:15

So I am working on something that wasn\'t well thought out in the build from the backend team. That leaves me with a document full of divs.

What I am doing is rolling b

5条回答
  •  广开言路
    2021-01-30 22:30

    You can select elements with multiple classes like so:

    $("element.firstClass.anotherClass");
    

    Simply chain the next class onto the first one, without a space (spaces mean "children of").

提交回复
热议问题