-
$("div > div", "#tab");
That will select all children of divs using the context of #tab
http://jsfiddle.net/HenryGarle/mHpMM/
讨论(0)
-
Try this
$("#tab > div > div")
You can use child selector (>) for select the child. See more info:
http://api.jquery.com/child-selector/
讨论(0)
-
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)
-
$("#tab").siblings();
[docs]
Quote from jquery:
Get the siblings of each element in the set of matched elements,
optionally filtered by a selector.
讨论(0)
- 热议问题