Similar to jQuery .closest() but traversing descendants?

后端 未结 16 714
情书的邮戳
情书的邮戳 2020-12-07 15:13

Is there a function similar to jQuery .closest() but for traversing descendants and returning only closest ones?

I know that there is

16条回答
  •  無奈伤痛
    2020-12-07 16:01

    What about this approach?

    $('find-my-closest-descendant').find('> div');
    

    This "direct child" selector works for me.

提交回复
热议问题