Possible Duplicate:
What doesa > bmean?
Hi could any one tel me what this style of selector is used for?
$("> div", "#main-content")
is it the same as
 $("div", "#main-content")
?
Not seen this style before and just stumbled on it in a template I just bought.
Just refer to http://api.jquery.com/child-selector/ to clear you doubt about >
Basically the > indicates, that only direct children are matched. If the > is omitted, then ever child of every level below is matched.
If you have a structure like this:
<div id="A">
  <div id="B">
    <div id="C"></div>
  </div>
</div>
a selector like:
#A > #B
Should return you B, but
#A > #C
would not match with C whereas
#A #C
would.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With