Is there an equivalent to .closest() that searches down the DOM tree instead of up?

后端 未结 6 1279
失恋的感觉
失恋的感觉 2020-12-20 11:15

Is there an equivalent to .closest() that searches down the DOM tree instead of up?

6条回答
  •  猫巷女王i
    2020-12-20 11:37

    In case somebody needs to search UP, it's easy with .parents() method.

    You can leave it empty, or specify selectors like .parents("div").

提交回复
热议问题