Efficient, concise way to find next matching sibling?

前端 未结 3 1191
你的背包
你的背包 2020-11-27 18:35

Sticking to the official jQuery API, is there a more concise, but not less efficient, way of finding the next sibling of an element that matches a given selector other than

3条回答
  •  情话喂你
    2020-11-27 19:23

    How about using the first method:

    jQuery.fn.nextMatching = function(selector) {
        return this.nextAll(selector).first();
    }
    

提交回复
热议问题