How can I select an element with multiple classes in jQuery?

前端 未结 13 2661
一向
一向 2020-11-22 00:51

I want to select all the elements that have the two classes a and b.


So, only the e

13条回答
  •  野性不改
    2020-11-22 01:04

    For better performance you can use

    $('div.a.b')
    

    This will look only through the div elements instead of stepping through all the html elements that you have on your page.

提交回复
热议问题