开发者

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

开发者 https://www.devze.com 2023-02-03 14:09 出处:网络
For example, if I have: <conversations> <status>1</status> <conversation> <status>0</status>

For example, if I have:

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

How do I go about gettin开发者_开发百科g < status > for < conversations > while ignoring < conversation >?


Use the child selector, >:

$('conversations > status')
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号