Multiple selector chaining in jQuery?

前端 未结 7 917
迷失自我
迷失自我 2020-11-29 03:23

Normally when I use a class as a selector I try to use an \"id\" selector with it so it does not search through the entire page but only an area where the class would be.

7条回答
  •  一个人的身影
    2020-11-29 03:59

    I think you might see slightly better performance by doing it this way:

    $("#Create, #Edit").find(".myClass").plugin(){
        // Options
    });
    

提交回复
热议问题