Can I combine a variable and a selector in Jquery?

前端 未结 3 2103
-上瘾入骨i
-上瘾入骨i 2021-02-15 14:12

Say I have this HTML:

top
middle
bottom
middle
3条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-15 14:50

    You can use find()

    Description: Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.

    $top.find(".middle");
    

提交回复
热议问题