Michael Novello
Michael Novello

Reputation: 4901

How do I only get TOP-level child tags that match what I am looking for?

For example, if I have:

<conversations>
  <status>1</status>
  <conversation>
    <status>0</status>
    <text>Hi</text>
  </conversation>
</conversations>

How do I go about getting < status > for < conversations > while ignoring < conversation >?

Upvotes: 1

Views: 798

Answers (1)

kevingessner
kevingessner

Reputation: 18985

Use the child selector, >:

$('conversations > status')

Upvotes: 1

Related Questions