How to use multiple jquery object variables as selectors?

后端 未结 3 670
独厮守ぢ
独厮守ぢ 2020-12-03 04:54

In jQuery, selecting more than one element can be done like this:

$(\"#id1,#id2\").show();

But when I have two jQuery objects, I don\'t see

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-03 05:40

    You can use each cycle:

    $([jqId1, jqId2]).each( function(){
        $(this).show();
    });
    

    As answered here: Select multiple jQuery objects with .add()

提交回复
热议问题