Similar to jQuery .closest() but traversing descendants?

后端 未结 16 737
情书的邮戳
情书的邮戳 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 15:57

    You can use find with the :first selector:

    $('#parent').find('p:first');
    

    The above line will find the first

    element in the descendants of #parent.

提交回复
热议问题