How to traverse the DOM elements of a JQuery object in IE7?
<p>I have an xml response from an API request stored in a JQuery object (called $xml). To get to the bit of information I need, I was using: <code>$xml[0].childNodes[0].childNodes[1].childNodes[1].textContent</code>. This works on Chrome, Firefox, and IE10+, but IE=&lt;9 does not represent the object the same way.</p>

<p>Code that works in Chrome, Firefox, and IE10+:</p>

<pre><code>$(function() {
  $.get('proxy.php', function(data) {
    if (typeof data == 'string') {
      console.error(data);
    } else {
      var test = $.parseXML(data);
      var $xml = $(data);
      console.log(data);

      alert($xml[0].childNodes[0].childNodes[1].childNodes[1].textContent);
    }
  });
});
</code></pre>

<p>In the debugger in IE it shows the [0] index of the object's array – but where other browsers then show descendants like 'children' and 'childNodes' – lower IE just shows <code>0: [object]</code>, with no option to expand and see inside of said <code>[object]</code>.</p>

<hr>

<p><strong>How can I traverse the contents of my JQuery object in a way that works in IE7+ as well as Chrome and Firefox?</strong></p>