How to select div inside div inside div with jquery

后端 未结 4 1186
一生所求
一生所求 2021-02-05 12:27
相关标签:
4条回答
  • 2021-02-05 12:47
    $("div > div", "#tab");
    

    That will select all children of divs using the context of #tab

    http://jsfiddle.net/HenryGarle/mHpMM/

    0 讨论(0)
  • 2021-02-05 12:52

    Try this

    $("#tab > div > div")
    

    You can use child selector (>) for select the child. See more info: http://api.jquery.com/child-selector/

    0 讨论(0)
  • 2021-02-05 12:54

    You could also use find method of JQuery. Find will return all the descendant elements of the selected element.

    $(selector).find(filter criteria)

    ex:

    $("div#tab").find("div")

    0 讨论(0)
  • 2021-02-05 12:55
    $("#tab").siblings();
    

    [docs]

    Quote from jquery:

    Get the siblings of each element in the set of matched elements, optionally filtered by a selector.

    0 讨论(0)
提交回复
热议问题