Select multiple jQuery objects with .add()

前端 未结 3 1460
慢半拍i
慢半拍i 2020-12-03 10:16

Does the .add() method allow selecting multiple objects in one go instead of adding one at a time?

one.add(two).add(three).add(four).on(\"click\", function()         


        
3条回答
  •  旧巷少年郎
    2020-12-03 10:27

    I'd prefer this array approach, purely for readability...

    $([one, two, three, four]).each(function() {
        // your function here
    });
    

提交回复
热议问题